[FFmpeg-devel] [PATCH] ffprobe: do not try to decode empty packets.

Nicolas George nicolas.george at normalesup.org
Fri Apr 20 16:22:55 CEST 2012


Fixes sporadic decode failures.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 ffprobe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


For example, the file created with:

ffmpeg -f lavfi -i testsrc -vcodec libx264 -preset medium -crf 18 -t 60 test.mkv

crashes with the following message after ~47 seconds:

[h264 @ 0x20cf8a0] Internal error, picture buffer overflow

I have seen other kinds of failures, such as frames stopping after ~30
seconds and then a message about too many threads when closing.

Regards,

-- 
  Nicolas George



diff --git a/ffprobe.c b/ffprobe.c
index 8a76a0b..43aa1c5 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1279,7 +1279,7 @@ static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)
         }
         if (do_read_frames) {
             pkt1 = pkt;
-            while (1) {
+            while (pkt1.size) {
                 avcodec_get_frame_defaults(&frame);
                 ret = get_decoded_frame(fmt_ctx, &frame, &got_frame, &pkt1);
                 if (ret < 0 || !got_frame)
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list