Merge commit '3a56bcee7cb7549b2813e39ce3bee3b7c522aecb'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Dec 2014 21:19:55 +0000 (22:19 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Dec 2014 21:21:56 +0000 (22:21 +0100)
* commit '3a56bcee7cb7549b2813e39ce3bee3b7c522aecb':
  mpeg12dec: Use more specific error codes

Conflicts:
libavcodec/mpeg12dec.c

See: 1852b2a0f497d3c5437d5b50379d7874fc8c285a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/mpeg12dec.c

@@@ -1286,12 -1240,8 +1286,9 @@@ static int mpeg_decode_postinit(AVCodec
              s->parse_context.buffer = 0;
              ff_mpv_common_end(s);
              s->parse_context = pc;
 +            s1->mpeg_enc_ctx_allocated = 0;
          }
  
-         if ((s->width == 0) || (s->height == 0))
-             return -2;
          ret = ff_set_dimensions(avctx, s->width, s->height);
          if (ret < 0)
              return ret;
@@@ -1896,21 -1877,12 +1893,21 @@@ static int mpeg_decode_slice(MpegEncCon
                               s->progressive_frame == 0
                               /* vbv_delay == 0xBBB || 0xE10 */;
  
 +                if (left >= 32 && !is_d10) {
 +                    GetBitContext gb = s->gb;
 +                    align_get_bits(&gb);
 +                    if (show_bits(&gb, 24) == 0x060E2B) {
 +                        av_log(avctx, AV_LOG_DEBUG, "Invalid MXF data found in video stream\n");
 +                        is_d10 = 1;
 +                    }
 +                }
 +
                  if (left < 0 ||
                      (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) ||
 -                    ((avctx->err_recognition & AV_EF_BUFFER) && left > 8)) {
 +                    ((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) {
                      av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n",
                             left, show_bits(&s->gb, FFMIN(left, 23)));
-                     return -1;
+                     return AVERROR_INVALIDDATA;
                  } else
                      goto eos;
              }