Unified · Split
| @@ -53,7 +53,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 52 unmodified lines | ||
| 53 | 53 | AVSubtitle *sub = data; |
| 54 | 54 | const uint8_t *buf_end = buf + buf_size; |
| 55 | 55 | uint8_t *bitmap; |
| 56 | − int w, h, x, y, i; | |
| 56 | + int w, h, x, y, i, ret; | |
| 57 | 57 | int64_t packet_time = 0; |
| 58 | 58 | GetBitContext gb; |
| 59 | 59 | int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); |
| @@ -145,7 +145,8 @@ FF_ENABLE_DEPRECATION_WARNINGS · 85 unmodified lines | ||
| 145 | 145 | #endif |
| 146 | 146 | |
| 147 | 147 | // process RLE-compressed data |
| 148 | − init_get_bits(&gb, buf, (buf_end - buf) * 8); | |
| 148 | + if ((ret = init_get_bits8(&gb, buf, buf_end - buf)) < 0) | |
| 149 | + return ret; | |
| 149 | 150 | bitmap = sub->rects[0]->data[0]; |
| 150 | 151 | for (y = 0; y < h; y++) { |
| 151 | 152 | // interlaced: do odd lines |