aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-04 17:59:25 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-14 19:00:20 +0100
commit9eda9d3322a6ea91830a754f2edee222adae7e67 (patch)
tree3f11547e1c7f6adcd6bfbacd6e20c63bf5d4281a /libavcodec/h264.c
parentecf442a58b09bdb1dc1d2c3904b82ac5f79b2878 (diff)
downloadffmpeg-9eda9d3322a6ea91830a754f2edee222adae7e67.tar.gz
h264: free the tables and uninitialize the context on flush
Prevents referencing empty frames when the first packet after the flush does not contain a frame.
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8faefbd81a..1444fc6d57 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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)