]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/smacker.c
avcodec/jpeg2000dec: Check bpno in decode_cblk()
[ffmpeg] / libavcodec / smacker.c
index b2fc29b138db56209e235fa7e9c86f69762c2d67..4014e8d04c1ed2adb15e434344515ee98d275ae2 100644 (file)
@@ -670,6 +670,10 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
 
     /* get output buffer */
     frame->nb_samples = unp_size / (avctx->channels * (bits + 1));
+    if (unp_size % (avctx->channels * (bits + 1))) {
+        av_log(avctx, AV_LOG_ERROR, "unp_size %d is odd\n", unp_size);
+        return AVERROR(EINVAL);
+    }
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
     samples  = (int16_t *)frame->data[0];