From e256761defe527c81521ae035ae3ee6f16265707 Mon Sep 17 00:00:00 2001 From: Marth64 Date: Wed, 27 Nov 2024 11:13:44 -0600 Subject: [PATCH] avformat/dvdvideodec: check return code of ff_dvdclut_yuv_to_rgb() Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 9916351e86..f92c5ae54a 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -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);