]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dvdsubdec: Check all fseek()s return codes
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Nov 2014 16:38:46 +0000 (17:38 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Nov 2014 16:50:18 +0000 (17:50 +0100)
Fixes CID1254660

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dvdsubdec.c

index d165934cc362bc93a24b8d8a5cfa18bbfaf71149..1fb0a3878e32e368bd587b04c55d57d786a961c3 100644 (file)
@@ -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++) {