X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fxsubdec.c;h=2a766b33f7f29cf6eb2757558d7e4b13de59ae59;hb=65ff562c3b305ed7ef979b3182de1c5e7264dd22;hp=b024535df607a5d118df0e0522b4209b042c33a8;hpb=1df08cae82d75e01b1250bb9416d6cfbab430e82;p=ffmpeg diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index b024535df60..2a766b33f7f 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -53,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVSubtitle *sub = data; const uint8_t *buf_end = buf + buf_size; uint8_t *bitmap; - int w, h, x, y, i; + int w, h, x, y, i, ret; int64_t packet_time = 0; GetBitContext gb; int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); @@ -145,7 +145,8 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif // process RLE-compressed data - init_get_bits(&gb, buf, (buf_end - buf) * 8); + if ((ret = init_get_bits8(&gb, buf, buf_end - buf)) < 0) + return ret; bitmap = sub->rects[0]->data[0]; for (y = 0; y < h; y++) { // interlaced: do odd lines