aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-03-10 23:28:31 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-11 18:30:31 +0100
commit555000c7d5c1e13043a948ebc48d2939b0ba6536 (patch)
treec5ce286f74a13bd19b1026efabcbe6f59ecd3497 /libavcodec/h264.c
parentd0a863ac891eae49ceaa4de7f759270bc87e668d (diff)
downloadffmpeg-555000c7d5c1e13043a948ebc48d2939b0ba6536.tar.gz
h264: check that DPB is allocated before accessing it in flush_dpb()
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index de5ca403ae..e0d5433a4e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2623,8 +2623,9 @@ static void flush_dpb(AVCodecContext *avctx)
flush_change(h);
- for (i = 0; i < MAX_PICTURE_COUNT; i++)
- unref_picture(h, &h->DPB[i]);
+ if (h->DPB)
+ for (i = 0; i < MAX_PICTURE_COUNT; i++)
+ unref_picture(h, &h->DPB[i]);
h->cur_pic_ptr = NULL;
unref_picture(h, &h->cur_pic);