]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/exr.c
mpegvideo: dont call draw edges on lowres
[ffmpeg] / libavcodec / exr.c
index f175706a3d5c0cdda5e007b9e84bd26e0d324ac6..8a6c8c706220797ba169afb24ce381c6d9ae957d 100644 (file)
@@ -403,19 +403,10 @@ static int decode_frame(AVCodecContext *avctx,
             if (!variable_buffer_data_size)
                 return AVERROR_INVALIDDATA;
 
-            s->compr = *buf;
-            switch (s->compr) {
-            case EXR_RAW:
-            case EXR_RLE:
-            case EXR_ZIP1:
-            case EXR_ZIP16:
-                break;
-            case EXR_PIZ:
-            case EXR_B44:
-            default:
-                av_log(avctx, AV_LOG_ERROR, "Compression type %d is not supported\n", s->compr);
-                return AVERROR_PATCHWELCOME;
-            }
+            if (s->compr == -1)
+                s->compr = *buf;
+            else
+                av_log(avctx, AV_LOG_WARNING, "Found more than one compression attribute\n");
 
             buf += variable_buffer_data_size;
             continue;
@@ -446,6 +437,11 @@ static int decode_frame(AVCodecContext *avctx,
         }
     }
 
+    if (s->compr == -1) {
+        av_log(avctx, AV_LOG_ERROR, "Missing compression attribute\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (buf >= buf_end) {
         av_log(avctx, AV_LOG_ERROR, "Incomplete frame\n");
         return AVERROR_INVALIDDATA;
@@ -478,6 +474,9 @@ static int decode_frame(AVCodecContext *avctx,
     case EXR_ZIP16:
         scan_lines_per_block = 16;
         break;
+    default:
+        av_log(avctx, AV_LOG_ERROR, "Compression type %d is not supported\n", s->compr);
+        return AVERROR_PATCHWELCOME;
     }
 
     if (s->picture.data[0])
@@ -642,6 +641,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     avcodec_get_frame_defaults(&s->picture);
     avctx->coded_frame = &s->picture;
 
+    s->compr = -1;
+
     return 0;
 }
 
@@ -661,7 +662,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
 AVCodec ff_exr_decoder = {
     .name               = "exr",
     .type               = AVMEDIA_TYPE_VIDEO,
-    .id                 = CODEC_ID_EXR,
+    .id                 = AV_CODEC_ID_EXR,
     .priv_data_size     = sizeof(EXRContext),
     .init               = decode_init,
     .close              = decode_end,