h264dec: initialize field_started to 0 on each decode call

Message ID 20170314093251.A88095DB0C@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau March 14, 2017, 9:32 a.m.
Module: libav
Branch: master
Commit: b76f6a76c6312dc551d7c37c6ded36bea7973c74

Author:    Anton Khirnov <anton@khirnov.net>
Committer: Anton Khirnov <anton@khirnov.net>
Date:      Wed Dec 28 11:05:25 2016 +0100

h264dec: initialize field_started to 0 on each decode call

It might be incorrectly set to 1 if the previous call exited with an
error.

Bug-Id: 1019
CC: libav-stable@libav.org

---

 libavcodec/h264dec.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 6d7aa7b..2a532a7 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -523,6 +523,7 @@  static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
 
     if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
         h->current_slice = 0;
+        h->field_started = 0;
         if (!h->first_field)
             h->cur_pic_ptr = NULL;
         ff_h264_sei_uninit(&h->sei);