summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264dec.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-12-18 11:29:25 +0100
committerAnton Khirnov <anton@khirnov.net>2016-12-19 08:15:58 +0100
commit45286a625c6ced1f5c4c842244cbb4509429abba (patch)
treec55d728226f215230e375240d0caddc7a654ac88 /libavcodec/h264dec.h
parentc2fa6bb0e8703a7a6aa10e11f9ab36094416d83f (diff)
downloadffmpeg-streaming-45286a625c6ced1f5c4c842244cbb4509429abba.zip
ffmpeg-streaming-45286a625c6ced1f5c4c842244cbb4509429abba.tar.gz
h264dec: make sure to only end a field if it has been started
Calling ff_h264_field_end() when the per-field state is not properly initialized leads to all kinds of undefined behaviour. CC: libav-stable@libav.org Bug-Id: 977 978 992
Diffstat (limited to 'libavcodec/h264dec.h')
-rw-r--r--libavcodec/h264dec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h
index f934fc4..2ffe4de 100644
--- a/libavcodec/h264dec.h
+++ b/libavcodec/h264dec.h
@@ -509,6 +509,11 @@ typedef struct H264Context {
* slices) anymore */
int setup_finished;
+ /* This is set to 1 if h264_field_start() has been called successfully,
+ * so all per-field state is properly initialized and we can decode
+ * the slice data */
+ int field_started;
+
AVFrame *output_frame;
int enable_er;
OpenPOWER on IntegriCloud