[FFmpeg-cvslog] avcodec/dvdsubdec: Check all fseek()s return codes
Michael Niedermayer
git at videolan.org
Sun Nov 16 17:51:03 CET 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 16 17:38:46 2014 +0100| [1de786777e0fb18ec1e44cea058c77e83980b6c4] | committer: Michael Niedermayer
avcodec/dvdsubdec: Check all fseek()s return codes
Fixes CID1254660
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1de786777e0fb18ec1e44cea058c77e83980b6c4
---
libavcodec/dvdsubdec.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index d165934..1fb0a38 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++) {
More information about the ffmpeg-cvslog
mailing list