[FFmpeg-cvslog] avcodec/mpc8: Correct end truncation
Michael Niedermayer
git at videolan.org
Sat Aug 13 16:30:01 EEST 2016
ffmpeg | branch: release/3.0 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 11 14:28:24 2016 +0200| [2577cfd207ee619198f80ac46e3e4832cfc5b83f] | committer: Michael Niedermayer
avcodec/mpc8: Correct end truncation
Fixes Ticket5478
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b21f674876badefc68e4deecdb4a1d46de10b67c)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2577cfd207ee619198f80ac46e3e4832cfc5b83f
---
libavcodec/mpc8.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index a8feb6c..8894457 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -415,10 +415,14 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
c->cur_frame++;
c->last_bits_used = get_bits_count(gb);
- if(get_bits_left(gb) < 8) // we have only padding left
- c->last_bits_used = buf_size << 3;
if(c->cur_frame >= c->frames)
c->cur_frame = 0;
+ if(c->cur_frame == 0 && get_bits_left(gb) < 8) {// we have only padding left
+ c->last_bits_used = buf_size << 3;
+ } else if (get_bits_left(gb) < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
+ c->last_bits_used = buf_size << 3;
+ }
*got_frame_ptr = 1;
More information about the ffmpeg-cvslog
mailing list