Mercurial > libavcodec.hg
changeset 901:07a677389920 libavcodec
10l fix
author | al3x |
---|---|
date | Tue, 03 Dec 2002 15:42:17 +0000 |
parents | 52c26a143399 |
children | 6acc8394960d |
files | mjpeg.c |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mjpeg.c Tue Dec 03 11:07:41 2002 +0000 +++ b/mjpeg.c Tue Dec 03 15:42:17 2002 +0000 @@ -877,8 +877,12 @@ 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 @@ 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 @@ { 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);