]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mxpegdec.c
adpcm: Clip step_index values read from the bitstream at the beginning of each frame.
[ffmpeg] / libavcodec / mxpegdec.c
index 7d6f7593339f71a6af24ea0617d03b30956367a6..6f0d0457f7bb359f383d6bf5ab6557617dda76ab 100644 (file)
@@ -47,9 +47,7 @@ static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
 
     s->picture[0].reference = s->picture[1].reference = 3;
     s->jpg.picture_ptr      = &s->picture[0];
-    ff_mjpeg_decode_init(avctx);
-
-    return 0;
+    return ff_mjpeg_decode_init(avctx);
 }
 
 static int mxpeg_decode_app(MXpegDecodeContext *s,
@@ -255,11 +253,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
                         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
                         return AVERROR(ENOMEM);
                     }
-                    jpg->picture_ptr->pict_type = FF_P_TYPE;
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
                     jpg->picture_ptr->key_frame = 0;
                     jpg->got_picture = 1;
                 } else {
-                    jpg->picture_ptr->pict_type = FF_I_TYPE;
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
                     jpg->picture_ptr->key_frame = 1;
                 }
 
@@ -275,9 +273,13 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
                         return AVERROR(ENOMEM);
                     }
 
-                    ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
+                    ret = ff_mjpeg_decode_sos(jpg, s->mxm_bitmask, reference_ptr);
+                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+                        return ret;
                 } else {
-                    ff_mjpeg_decode_sos(jpg, NULL, NULL);
+                    ret = ff_mjpeg_decode_sos(jpg, NULL, NULL);
+                    if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+                        return ret;
                 }
 
                 break;