<p dir="auto">I'm largely adding this as an additional test to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135070289" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/14426" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/14426/hovercard" href="https://github.com/golang/go/issues/14426">#14426</a>.</p>
<p dir="auto"><a href="https://github.com/stephenwithav/ffmpeg/blob/develop/ffmpeg_test.go#L14">TestEncoderUsage</a> fails with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="go test -v                                                                                                                                                                                                                                                                                                                     
=== RUN   TestEncoderUsage                                                                                                                                                                                                                                                                                                     
2016/02/21 14:57:22 Encoder dimensions: 640, 480                                                                                                                                                                                                                                                                               
--- FAIL: TestEncoderUsage (0.00s)                                                                                                                                                                                                                                                                                             
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]                                                                                                                                                                                                                                                    
        panic: runtime error: cgo argument has Go pointer to Go pointer                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                                                         
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:464 +0x3e6                                                                                                                                                                                                                                                                          
testing.tRunner.func1(0xc8200a0000)                                                                                                                                                                                                                                                                                            
        /usr/local/go/src/testing/testing.go:467 +0x192                                                                                                                                                                                                                                                                        
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:426 +0x4e9                                                                                                                                                                                                                                                                          
github.com/stephenwithav/ffmpeg.(*Encoder).WriteFrame(0xc820070300, 0x7fa104dd7688, 0xc820014640, 0x0, 0x0)                                                                                                                                                                                                                    
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg.go:143 +0x465                                                                                                                                                                                                                                     
github.com/stephenwithav/ffmpeg.TestEncoderUsage(0xc8200a0000)                                                                                                                                                                                                                                                                 
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg_test.go:35 +0x83f                                                                                                                                                                                                                                 
testing.tRunner(0xc8200a0000, 0x885260)                                                                                                                                                                                                                                                                                        
        /usr/local/go/src/testing/testing.go:473 +0x98                                                                                                                                                                                                                                                                         
created by testing.RunTests                                                                                                                                                                                                                                                                                                    
        /usr/local/go/src/testing/testing.go:582 +0x892                                                                                                                                                                                                                                                                        
exit status 2                                                                                                                                                                                                                                                                                                                  
FAIL    github.com/stephenwithav/ffmpeg 0.052s  "><pre class="notranslate"><code class="notranslate">go test -v                                                                                                                                                                                                                                                                                                                     
=== RUN   TestEncoderUsage                                                                                                                                                                                                                                                                                                     
2016/02/21 14:57:22 Encoder dimensions: 640, 480                                                                                                                                                                                                                                                                               
--- FAIL: TestEncoderUsage (0.00s)                                                                                                                                                                                                                                                                                             
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]                                                                                                                                                                                                                                                    
        panic: runtime error: cgo argument has Go pointer to Go pointer                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                                                         
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:464 +0x3e6                                                                                                                                                                                                                                                                          
testing.tRunner.func1(0xc8200a0000)                                                                                                                                                                                                                                                                                            
        /usr/local/go/src/testing/testing.go:467 +0x192                                                                                                                                                                                                                                                                        
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:426 +0x4e9                                                                                                                                                                                                                                                                          
github.com/stephenwithav/ffmpeg.(*Encoder).WriteFrame(0xc820070300, 0x7fa104dd7688, 0xc820014640, 0x0, 0x0)                                                                                                                                                                                                                    
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg.go:143 +0x465                                                                                                                                                                                                                                     
github.com/stephenwithav/ffmpeg.TestEncoderUsage(0xc8200a0000)                                                                                                                                                                                                                                                                 
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg_test.go:35 +0x83f                                                                                                                                                                                                                                 
testing.tRunner(0xc8200a0000, 0x885260)                                                                                                                                                                                                                                                                                        
        /usr/local/go/src/testing/testing.go:473 +0x98                                                                                                                                                                                                                                                                         
created by testing.RunTests                                                                                                                                                                                                                                                                                                    
        /usr/local/go/src/testing/testing.go:582 +0x892                                                                                                                                                                                                                                                                        
exit status 2                                                                                                                                                                                                                                                                                                                  
FAIL    github.com/stephenwithav/ffmpeg 0.052s  
</code></pre></div>
<p dir="auto">The offending code on line <a href="https://github.com/stephenwithav/ffmpeg/blob/develop/ffmpeg.go#L143">143</a>:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    // Perform scaling from input type to output type
    C.sws_scale(e._swscontext, &amp;input_data[0], &amp;input_linesize[0],
        0, e._context.height,
        &amp;e._frame.data[0], &amp;e._frame.linesize[0])"><pre class="notranslate">    <span class="pl-c">// Perform scaling from input type to output type</span>
    <span class="pl-s1">C</span>.<span class="pl-en">sws_scale</span>(<span class="pl-s1">e</span>.<span class="pl-c1">_swscontext</span>, <span class="pl-c1">&amp;</span><span class="pl-s1">input_data</span>[<span class="pl-c1">0</span>], <span class="pl-c1">&amp;</span><span class="pl-s1">input_linesize</span>[<span class="pl-c1">0</span>],
        <span class="pl-c1">0</span>, <span class="pl-s1">e</span>.<span class="pl-c1">_context</span>.<span class="pl-c1">height</span>,
        <span class="pl-c1">&amp;</span><span class="pl-s1">e</span>.<span class="pl-c1">_frame</span>.<span class="pl-c1">data</span>[<span class="pl-c1">0</span>], <span class="pl-c1">&amp;</span><span class="pl-s1">e</span>.<span class="pl-c1">_frame</span>.<span class="pl-c1">linesize</span>[<span class="pl-c1">0</span>])</pre></div>
<p dir="auto">Any help would be appreciated.</p>
<p dir="auto">I'm largely adding this as an additional test to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135070289" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/14426" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/14426/hovercard" href="https://github.com/golang/go/issues/14426">#14426</a>.</p>
<p dir="auto"><a href="https://github.com/stephenwithav/ffmpeg/blob/develop/ffmpeg_test.go#L14">TestEncoderUsage</a> fails with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="go test -v                                                                                                                                                                                                                                                                                                                     
=== RUN   TestEncoderUsage                                                                                                                                                                                                                                                                                                     
2016/02/21 14:57:22 Encoder dimensions: 640, 480                                                                                                                                                                                                                                                                               
--- FAIL: TestEncoderUsage (0.00s)                                                                                                                                                                                                                                                                                             
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]                                                                                                                                                                                                                                                    
        panic: runtime error: cgo argument has Go pointer to Go pointer                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                                                         
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:464 +0x3e6                                                                                                                                                                                                                                                                          
testing.tRunner.func1(0xc8200a0000)                                                                                                                                                                                                                                                                                            
        /usr/local/go/src/testing/testing.go:467 +0x192                                                                                                                                                                                                                                                                        
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:426 +0x4e9                                                                                                                                                                                                                                                                          
github.com/stephenwithav/ffmpeg.(*Encoder).WriteFrame(0xc820070300, 0x7fa104dd7688, 0xc820014640, 0x0, 0x0)                                                                                                                                                                                                                    
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg.go:143 +0x465                                                                                                                                                                                                                                     
github.com/stephenwithav/ffmpeg.TestEncoderUsage(0xc8200a0000)                                                                                                                                                                                                                                                                 
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg_test.go:35 +0x83f                                                                                                                                                                                                                                 
testing.tRunner(0xc8200a0000, 0x885260)                                                                                                                                                                                                                                                                                        
        /usr/local/go/src/testing/testing.go:473 +0x98                                                                                                                                                                                                                                                                         
created by testing.RunTests                                                                                                                                                                                                                                                                                                    
        /usr/local/go/src/testing/testing.go:582 +0x892                                                                                                                                                                                                                                                                        
exit status 2                                                                                                                                                                                                                                                                                                                  
FAIL    github.com/stephenwithav/ffmpeg 0.052s  "><pre class="notranslate"><code class="notranslate">go test -v                                                                                                                                                                                                                                                                                                                     
=== RUN   TestEncoderUsage                                                                                                                                                                                                                                                                                                     
2016/02/21 14:57:22 Encoder dimensions: 640, 480                                                                                                                                                                                                                                                                               
--- FAIL: TestEncoderUsage (0.00s)                                                                                                                                                                                                                                                                                             
panic: runtime error: cgo argument has Go pointer to Go pointer [recovered]                                                                                                                                                                                                                                                    
        panic: runtime error: cgo argument has Go pointer to Go pointer                                                                                                                                                                                                                                                        

goroutine 5 [running]:                                                                                                                                                                                                                                                                                                         
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:464 +0x3e6                                                                                                                                                                                                                                                                          
testing.tRunner.func1(0xc8200a0000)                                                                                                                                                                                                                                                                                            
        /usr/local/go/src/testing/testing.go:467 +0x192                                                                                                                                                                                                                                                                        
panic(0x57b820, 0xc8200106d0)                                                                                                                                                                                                                                                                                                  
        /usr/local/go/src/runtime/panic.go:426 +0x4e9                                                                                                                                                                                                                                                                          
github.com/stephenwithav/ffmpeg.(*Encoder).WriteFrame(0xc820070300, 0x7fa104dd7688, 0xc820014640, 0x0, 0x0)                                                                                                                                                                                                                    
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg.go:143 +0x465                                                                                                                                                                                                                                     
github.com/stephenwithav/ffmpeg.TestEncoderUsage(0xc8200a0000)                                                                                                                                                                                                                                                                 
        /home/steven/repos/gopath/src/github.com/stephenwithav/ffmpeg/ffmpeg_test.go:35 +0x83f                                                                                                                                                                                                                                 
testing.tRunner(0xc8200a0000, 0x885260)                                                                                                                                                                                                                                                                                        
        /usr/local/go/src/testing/testing.go:473 +0x98                                                                                                                                                                                                                                                                         
created by testing.RunTests                                                                                                                                                                                                                                                                                                    
        /usr/local/go/src/testing/testing.go:582 +0x892                                                                                                                                                                                                                                                                        
exit status 2                                                                                                                                                                                                                                                                                                                  
FAIL    github.com/stephenwithav/ffmpeg 0.052s  
</code></pre></div>
<p dir="auto">The offending code on line <a href="https://github.com/stephenwithav/ffmpeg/blob/develop/ffmpeg.go#L143">143</a>:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    // Perform scaling from input type to output type
    C.sws_scale(e._swscontext, &amp;input_data[0], &amp;input_linesize[0],
        0, e._context.height,
        &amp;e._frame.data[0], &amp;e._frame.linesize[0])"><pre class="notranslate">    <span class="pl-c">// Perform scaling from input type to output type</span>
    <span class="pl-s1">C</span>.<span class="pl-en">sws_scale</span>(<span class="pl-s1">e</span>.<span class="pl-c1">_swscontext</span>, <span class="pl-c1">&amp;</span><span class="pl-s1">input_data</span>[<span class="pl-c1">0</span>], <span class="pl-c1">&amp;</span><span class="pl-s1">input_linesize</span>[<span class="pl-c1">0</span>],
        <span class="pl-c1">0</span>, <span class="pl-s1">e</span>.<span class="pl-c1">_context</span>.<span class="pl-c1">height</span>,
        <span class="pl-c1">&amp;</span><span class="pl-s1">e</span>.<span class="pl-c1">_frame</span>.<span class="pl-c1">data</span>[<span class="pl-c1">0</span>], <span class="pl-c1">&amp;</span><span class="pl-s1">e</span>.<span class="pl-c1">_frame</span>.<span class="pl-c1">linesize</span>[<span class="pl-c1">0</span>])</pre></div>
<p dir="auto">Any help would be appreciated.</p>