Mercurial > libavcodec.hg
comparison interplayvideo.c @ 1770:cd36e37fb879 libavcodec
handle invalid buffer sizes
author | melanson |
---|---|
date | Sat, 31 Jan 2004 18:17:38 +0000 |
parents | 932d306bf1dc |
children | 129236143f2e |
comparison
equal
deleted
inserted
replaced
1769:1514fd5d434b | 1770:cd36e37fb879 |
---|---|
898 uint8_t *buf, int buf_size) | 898 uint8_t *buf, int buf_size) |
899 { | 899 { |
900 IpvideoContext *s = avctx->priv_data; | 900 IpvideoContext *s = avctx->priv_data; |
901 AVPaletteControl *palette_control = avctx->palctrl; | 901 AVPaletteControl *palette_control = avctx->palctrl; |
902 | 902 |
903 /* compressed buffer needs to be large enough to at least hold an entire | |
904 * decoding map */ | |
905 if (buf_size < s->decoding_map_size) | |
906 return buf_size; | |
907 | |
903 s->decoding_map = buf; | 908 s->decoding_map = buf; |
904 s->buf = buf + s->decoding_map_size; | 909 s->buf = buf + s->decoding_map_size; |
905 s->size = buf_size - s->decoding_map_size; | 910 s->size = buf_size - s->decoding_map_size; |
906 | 911 |
907 s->current_frame.reference = 3; | 912 s->current_frame.reference = 3; |