avcodec/vp3: Check init_get_bits8() for failure

Fixes CID1322316

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cbd3cd8eb2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-09-04 01:13:05 +02:00
parent 95db0aa276
commit dceec28eac
1 changed files with 4 additions and 1 deletions

View File

@ -2473,6 +2473,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
const uint8_t *header_start[3]; const uint8_t *header_start[3];
int header_len[3]; int header_len[3];
int i; int i;
int ret;
avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
@ -2492,7 +2493,9 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (header_len[i] <= 0) if (header_len[i] <= 0)
continue; continue;
init_get_bits8(&gb, header_start[i], header_len[i]); ret = init_get_bits8(&gb, header_start[i], header_len[i]);
if (ret < 0)
return ret;
ptype = get_bits(&gb, 8); ptype = get_bits(&gb, 8);