aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2002-12-03 15:42:17 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2002-12-03 15:42:17 +0000
commit17308326396778cd31451ef7a69c36c7ccb7cab7 (patch)
treeb58a8de0f08b9c5a73b5e9ed4fdf0098f52df0d0 /libavcodec
parent843342efb77b1e2545c7f7ea6e6eca37482670b1 (diff)
downloadffmpeg-17308326396778cd31451ef7a69c36c7ccb7cab7.tar.gz
10l fix
Originally committed as revision 1300 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpeg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 899aa06e51..490f1ffae3 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -877,8 +877,12 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s)
if (s->interlaced)
w *= 2;
s->linesize[i] = w;
- /* memory test is done in mjpeg_decode_sos() */
s->current_picture[i] = av_mallocz(w * h);
+ if (!s->current_picture[i])
+ {
+ dprintf("error: no picture buffers allocated\n");
+ return -1;
+ }
}
s->first_picture = 0;
}
@@ -1419,7 +1423,8 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
mjpeg_decode_dht(s);
break;
case SOF0:
- mjpeg_decode_sof0(s);
+ if (mjpeg_decode_sof0(s) < 0)
+ return -1;
break;
case EOI:
eoi_parser:
@@ -1578,7 +1583,8 @@ read_header:
{
init_get_bits(&s->gb, buf+sof_offs, buf_end - (buf+sof_offs));
s->start_code = SOF0;
- mjpeg_decode_sof0(s);
+ if (mjpeg_decode_sof0(s) < 0)
+ return -1;
}
sos_offs = get_bits(&hgb, 32);