ffprobe: fix infinite loop in subtitle decoding
authorMarton Balint <cus@passwd.hu>
Sun, 11 Mar 2018 17:02:12 +0000 (18:02 +0100)
committerMarton Balint <cus@passwd.hu>
Mon, 12 Mar 2018 20:11:06 +0000 (21:11 +0100)
Fixes a regression since 2a88ebd096f3c748a2d99ed1b60b22879b3c567c which caused
an infinite loop in the subtitle decoding.

Fixes ticket #6796.

Signed-off-by: Marton Balint <cus@passwd.hu>
fftools/ffprobe.c

index 967adbe..a4ac697 100644 (file)
@@ -2275,7 +2275,8 @@ static av_always_inline int process_frame(WriterContext *w,
             break;
 
         case AVMEDIA_TYPE_SUBTITLE:
-            ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_frame, pkt);
+            if (*packet_new)
+                ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_frame, pkt);
             *packet_new = 0;
             break;
         default: