]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/atrac3.c
avcodec/atrac3: Check block_align
[ffmpeg] / libavcodec / atrac3.c
index 6cdcdf19644e8f613a9aa3e534dd804126df50a6..dc19a3863e68aada4bc9246506a3d9e712961ac9 100644 (file)
@@ -964,7 +964,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    if (avctx->block_align >= UINT_MAX / 2)
+    if (avctx->block_align >= UINT_MAX / 2 || avctx->block_align <= 0)
         return AVERROR(EINVAL);
 
     q->decoded_bytes_buffer = av_mallocz(FFALIGN(avctx->block_align, 4) +