@@ -1126,6 +1126,9 @@ static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p,
h = s->height;
}
+ if (avctx->skip_frame == AVDISCARD_ALL)
+ return data_size;
+
/* parse transformations */
s->nb_transforms = 0;
s->reduced_width = s->width;
@@ -1339,7 +1342,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVFrame * const p = data;
WebPContext *s = avctx->priv_data;
GetByteContext gb;
- int ret;
+ int ret, got_frame_chunk = 0;
uint32_t chunk_type, chunk_size;
int vp8x_flags = 0;
@@ -1392,6 +1395,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
chunk_size);
if (ret < 0)
return ret;
+ got_frame_chunk = 1;
}
bytestream2_skip(&gb, chunk_size);
break;
@@ -1403,6 +1407,7 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (ret < 0)
return ret;
avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
+ got_frame_chunk = 1;
}
bytestream2_skip(&gb, chunk_size);
break;
@@ -1524,7 +1529,7 @@ exif_end:
}
}
- if (!*got_frame) {
+ if (!got_frame_chunk) {
av_log(avctx, AV_LOG_ERROR, "image data not found\n");
return AVERROR_INVALIDDATA;
}
@@ -1565,5 +1570,5 @@ const AVCodec ff_webp_decoder = {
.decode = webp_decode_frame,
.close = webp_decode_close,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
};