summaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorSasi Inguva <[email protected]>2016-11-04 15:31:58 -0700
committerMichael Niedermayer <[email protected]>2016-11-10 17:44:47 +0100
commit18108f36183836e9651f79f4c779737264318aa1 (patch)
tree1261cea269587c0d536dc395bdbffd262e7e0b2a /libavcodec/utils.c
parentc8dc11bb9ef92b8e90142a41e91b192346f4d7a0 (diff)
lavc/utils.c: Make sure skip_samples never goes negative.
Signed-off-by: Sasi Inguva <[email protected]> Reviewed-by: Derek Buitenhuis <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 87de15fc62..d6dca180e7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2391,7 +2391,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
if ((frame->flags & AV_FRAME_FLAG_DISCARD) && *got_frame_ptr &&
!(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
- avctx->internal->skip_samples -= frame->nb_samples;
+ avctx->internal->skip_samples = FFMAX(0, avctx->internal->skip_samples - frame->nb_samples);
*got_frame_ptr = 0;
}