lavc/mjpegenc: Fix not writing RST tag after final slice.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Mon, 20 Jan 2020 22:57:38 +0000 (23:57 +0100)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Tue, 21 Jan 2020 13:29:04 +0000 (14:29 +0100)
Fixes ticket #8412.

libavcodec/mjpegenc_common.c

index 31868c9..3038ebd 100644 (file)
@@ -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: