diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-16 17:38:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-16 17:50:18 +0100 |
commit | 1de786777e0fb18ec1e44cea058c77e83980b6c4 (patch) | |
tree | 7dd537296230cfb9fc21a8d7ca86247d62e5ef89 /libavcodec/dvdsubdec.c | |
parent | 530eb6acf8ee867bf00728bf7efaf505da107e17 (diff) | |
download | ffmpeg-1de786777e0fb18ec1e44cea058c77e83980b6c4.tar.gz |
avcodec/dvdsubdec: Check all fseek()s return codes
Fixes CID1254660
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r-- | libavcodec/dvdsubdec.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index d165934cc3..1fb0a3878e 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -605,13 +605,22 @@ static int parse_ifo_palette(DVDSubContext *ctx, char *p) ret = AVERROR_INVALIDDATA; goto end; } - fseek(ifo, 0xCC, SEEK_SET); + if (fseek(ifo, 0xCC, SEEK_SET) == -1) { + ret = AVERROR(errno); + goto end; + } if (fread(&sp_pgci, 4, 1, ifo) == 1) { pgci = av_be2ne32(sp_pgci) * 2048; - fseek(ifo, pgci + 0x0C, SEEK_SET); + if (fseek(ifo, pgci + 0x0C, SEEK_SET) == -1) { + ret = AVERROR(errno); + goto end; + } if (fread(&off_pgc, 4, 1, ifo) == 1) { pgc = pgci + av_be2ne32(off_pgc); - fseek(ifo, pgc + 0xA4, SEEK_SET); + if (fseek(ifo, pgc + 0xA4, SEEK_SET) == -1) { + ret = AVERROR(errno); + goto end; + } if (fread(yuv, 64, 1, ifo) == 1) { buf = yuv; for(i=0; i<16; i++) { |