avformat/dvdvideodec: check return code of ff_dvdclut_yuv_to_rgb()

Signed-off-by: Marth64 <marth64@proxyid.net>
This commit is contained in:
Marth64 2024-11-27 11:13:44 -06:00
parent a5a899bfcb
commit e256761def

View file

@ -1299,6 +1299,7 @@ static int dvdvideo_subp_stream_analyze(AVFormatContext *s, uint32_t offset, sub
{
DVDVideoDemuxContext *c = s->priv_data;
int ret;
char lang_dvd[3] = {0};
entry->startcode = 0x20 + (offset & 0x1F);
@ -1310,7 +1311,9 @@ static int dvdvideo_subp_stream_analyze(AVFormatContext *s, uint32_t offset, sub
/* dvdsub palettes currently have no colorspace tagging and all muxers only support RGB */
/* this is not a lossless conversion, but no use cases are supported for the original YUV */
ff_dvdclut_yuv_to_rgb(entry->clut, FF_DVDCLUT_CLUT_SIZE);
ret = ff_dvdclut_yuv_to_rgb(entry->clut, FF_DVDCLUT_CLUT_SIZE);
if (ret < 0)
return ret;
AV_WB16(lang_dvd, subp_attr.lang_code);
entry->lang_iso = ff_convert_lang_to(lang_dvd, AV_LANG_ISO639_2_BIBL);