You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/dvbsubenc: fix 256 color rle decoding
The end of 8-bit/pixel_code_string() is signalled with two zero bytes, so we should read those from the buffer instead of one. We keep supporting though our own buggy encoder which only put one zero byte there. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@ -660,6 +660,10 @@ static int dvbsub_read_8bit_string(AVCodecContext *avctx,
|
|||||||
if (bytestream2_get_byte(gb))
|
if (bytestream2_get_byte(gb))
|
||||||
av_log(avctx, AV_LOG_ERROR, "line overflow\n");
|
av_log(avctx, AV_LOG_ERROR, "line overflow\n");
|
||||||
|
|
||||||
|
/* Workaround our own buggy encoder which only put one zero at the end */
|
||||||
|
if (!bytestream2_peek_byte(gb))
|
||||||
|
bytestream2_get_byte(gb);
|
||||||
|
|
||||||
*srcbuf += bytestream2_tell(gb);
|
*srcbuf += bytestream2_tell(gb);
|
||||||
return pixels_read;
|
return pixels_read;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user