Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-07-27 19:22:41 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-07-27 20:29:55 +0300
commit8385e1718ee1fed107ec911d0b17fed3f7d74c71 (patch)
tree50614cfa1fba989fdb923232cf45d5a9ae1340a4 /libavcodec/h264_slice.c
parentad14aab3b4f88cdb6c2a3f8877c578e5a8042f1d (diff)
avcodec/h264_slice: Make setup_finished check cover more cases
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 1fe89c3c49..e1de971059 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1560,12 +1560,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
if (ret < 0)
return ret;
+ if (sl->first_mb_addr == 0 || !h->current_slice) {
+ if (h->setup_finished) {
+ av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
if (h->current_slice) {
- if (h->setup_finished) {
- av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
- return AVERROR_INVALIDDATA;
- }
if (h->max_contexts > 1) {
if (!h->single_decode_warning) {
av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple access units as slice threads\n");