diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 0912f86a14..4f9b949926 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -366,6 +366,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, side= av_packet_get_side_data(avci->last_pkt_props, AV_PKT_DATA_SKIP_SAMPLES, &side_size); if(side && side_size>=10) { avci->skip_samples = AV_RL32(side) * avci->skip_samples_multiplier; + avci->skip_samples = FFMAX(0, avci->skip_samples); discard_padding = AV_RL32(side + 4); av_log(avctx, AV_LOG_DEBUG, "skip %d / discard %d samples due to side data\n", avci->skip_samples, (int)discard_padding);