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;
}
}
+ 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;
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])
avcodec_get_frame_defaults(&s->picture);
avctx->coded_frame = &s->picture;
+ s->compr = -1;
+
return 0;
}