h264: free the tables and uninitialize the context on flush
authorAnton Khirnov <anton@khirnov.net>
Mon, 4 Nov 2013 16:59:25 +0000 (17:59 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 14 Nov 2013 18:00:20 +0000 (19:00 +0100)
Prevents referencing empty frames when the first packet after the flush
does not contain a frame.

libavcodec/h264.c

index 8faefbd..1444fc6 100644 (file)
@@ -2768,6 +2768,9 @@ static void flush_dpb(AVCodecContext *avctx)
     h->parse_context.overread_index    = 0;
     h->parse_context.index             = 0;
     h->parse_context.last_index        = 0;
+
+    free_tables(h, 1);
+    h->context_initialized = 0;
 }
 
 int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc)