avformat/iff: Check the CMAP read size

Fixes: use of uninitialized memory
Fixes: 5bX0wHRp9uuN
Use of uninitialized memory Replicated through UnModified FFmpeg (ffprobe) with Valgrind
Found during triage of the security report fo0u77U9tJ8g
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-10-10 21:41:14 +00:00
1 parent 489c5905e9
commit bda6ec0d52
1 file changed
+1 -1
+1 -1
View File
@@ -568,7 +568,7 @@ static int iff_read_header(AVFormatContext *s)
data_size + IFF_EXTRA_VIDEO_SIZE);
if (res < 0)
return res;
if ((res = avio_read(pb, stv->codecpar->extradata + IFF_EXTRA_VIDEO_SIZE, data_size)) < 0) {
if ((res = ffio_read_size(pb, stv->codecpar->extradata + IFF_EXTRA_VIDEO_SIZE, data_size)) < 0) {
av_freep(&stv->codecpar->extradata);
stv->codecpar->extradata_size = 0;
return res;