[FFmpeg-cvslog] ra288: Check block align.

Michael Niedermayer git at videolan.org
Sat Nov 24 16:38:54 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 24 16:17:29 2012 +0100| [5c392bac9a11b3a2db9c0ec082695cbb2bfad430] | committer: Michael Niedermayer

ra288: Check block align.

Fixes OOM
Fixes Ticket1893

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c392bac9a11b3a2db9c0ec082695cbb2bfad430
---

 libavcodec/ra288.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index a9f67bf..cefc99c 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -67,6 +67,11 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
     avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
 
+    if (avctx->block_align <= 0) {
+        av_log_ask_for_sample(avctx, "unsupported block align\n");
+        return AVERROR_PATCHWELCOME;
+    }
+
     avpriv_float_dsp_init(&ractx->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
 
     avcodec_get_frame_defaults(&ractx->frame);



More information about the ffmpeg-cvslog mailing list