diff options
author | James Almer <jamrial@gmail.com> | 2022-01-31 22:56:46 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-02-05 09:44:59 -0300 |
commit | 22d6d2b4818f3b1b451d1b4c4dd3d484e3040261 (patch) | |
tree | c8d7da3d575e33bdf0ed9df924ab556851df4696 /libavcodec/decode.c | |
parent | 3b9bd63ad92967e06d5e2f67e0cfd9093bf7700d (diff) | |
download | ffmpeg-22d6d2b4818f3b1b451d1b4c4dd3d484e3040261.tar.gz |
avcodec/decode: ignore unsupported skip samples packet side data values
Same as in the AV_FRAME_FLAG_DISCARD codepath, ensure avci->skip_samples is not
negative.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); |