[FFmpeg-devel] [PATCH] examples/muxing: init AVPacket before av_read_frame()

Andrey Utkin andrey.krieger.utkin at gmail.com
Tue Jan 28 15:58:58 CET 2014


av_read_frame() uses AVPacket.buf pointer value, so we must initialize
it with NULL. av_init_packet() does this, besides other.
---
 doc/examples/remuxing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/examples/remuxing.c b/doc/examples/remuxing.c
index e58393b..e9c4219 100644
--- a/doc/examples/remuxing.c
+++ b/doc/examples/remuxing.c
@@ -121,6 +121,7 @@ int main(int argc, char **argv)
     while (1) {
         AVStream *in_stream, *out_stream;
 
+        av_init_packet(&pkt);
         ret = av_read_frame(ifmt_ctx, &pkt);
         if (ret < 0)
             break;
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list