[FFmpeg-cvslog] lavc/mjpegenc: Fix not writing RST tag after final slice.

Carl Eugen Hoyos git at videolan.org
Tue Jan 21 15:29:22 EET 2020


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Mon Jan 20 23:57:38 2020 +0100| [f2e78644962fa93edb0b1cf92397f99e772d92d6] | committer: Carl Eugen Hoyos

lavc/mjpegenc: Fix not writing RST tag after final slice.

Fixes ticket #8412.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2e78644962fa93edb0b1cf92397f99e772d92d6
---

 libavcodec/mjpegenc_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index 31868c9bed..3038ebde6e 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -573,7 +573,7 @@ int ff_mjpeg_encode_stuffing(MpegEncContext *s)
 
     ff_mjpeg_escape_FF(pbc, s->esc_pos);
 
-    if((s->avctx->active_thread_type & FF_THREAD_SLICE) && mb_y < s->mb_height)
+    if((s->avctx->active_thread_type & FF_THREAD_SLICE) && mb_y < s->mb_height - 1)
         put_marker(pbc, RST0 + (mb_y&7));
     s->esc_pos = put_bits_count(pbc) >> 3;
 fail:



More information about the ffmpeg-cvslog mailing list