summaryrefslogtreecommitdiff
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-04 17:15:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-06 03:54:17 +0200
commite813df4fa345684cc5a63da0510c14f197c9b732 (patch)
tree192967d0635030c9ded4e28e25277482c8836930 /libavcodec/decode.c
parent523205ce1ed9415183c162998c68f573479e78fe (diff)
avcodec: Avoid splitting side data repeatedly
Fixes Timeout Fixes: 508/clusterfuzz-testcase-6245747678773248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 708071fd07..43ba04550a 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -392,7 +392,9 @@ static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame)
tmp = *pkt;
#if FF_API_MERGE_SD
FF_DISABLE_DEPRECATION_WARNINGS
- did_split = av_packet_split_side_data(&tmp);
+ did_split = avci->compat_decode_partial_size ?
+ ff_packet_split_and_drop_side_data(&tmp) :
+ av_packet_split_side_data(&tmp);
if (did_split) {
ret = extract_packet_props(avctx->internal, &tmp);
@@ -961,6 +963,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
AVPacket *avpkt)
{
int i, ret = 0;
+ AVCodecInternal *avci = avctx->internal;
if (!avpkt->data && avpkt->size) {
av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n");
@@ -981,7 +984,9 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
AVPacket tmp = *avpkt;
#if FF_API_MERGE_SD
FF_DISABLE_DEPRECATION_WARNINGS
- int did_split = av_packet_split_side_data(&tmp);
+ int did_split = avci->compat_decode_partial_size ?
+ ff_packet_split_and_drop_side_data(&tmp) :
+ av_packet_split_side_data(&tmp);
//apply_param_change(avctx, &tmp);
if (did_split) {