avformat/sierravmd: fix header read error check

The header read check stored the comparison result into ret, so read
failures became ret=1 and were treated as success, leaving the VMD header
uninitialized and letting parsing continue with bogus state.

Regression since: ee623a43e3.
Found-by: Pwno
This commit is contained in:
Ruikai Peng
2025-12-11 06:27:48 +00:00
committed by James Almer
parent a4cb6c724b
commit bb424927db

View File

@@ -103,7 +103,7 @@ static int vmd_read_header(AVFormatContext *s)
/* fetch the main header, including the 2 header length bytes */
avio_seek(pb, 0, SEEK_SET);
if ((ret = ffio_read_size(pb, vmd->vmd_header, VMD_HEADER_SIZE) < 0))
if ((ret = ffio_read_size(pb, vmd->vmd_header, VMD_HEADER_SIZE)) < 0)
return ret;
width = AV_RL16(&vmd->vmd_header[12]);