]> git.sesse.net Git - ffmpeg/blobdiff - ffprobe.c
avcodec/avpacket: Fix off by 5 error
[ffmpeg] / ffprobe.c
index 4dfb833b3f9ea5524c3c24f47d1a1eaa69c3a632..a7e329c107de025715fe4587b9d0e229f35e2c36 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1956,7 +1956,7 @@ static av_always_inline int process_frame(WriterContext *w,
     AVSubtitle sub;
     int ret = 0, got_frame = 0;
 
-    if (dec_ctx->codec) {
+    if (dec_ctx && dec_ctx->codec) {
         switch (par->codec_type) {
         case AVMEDIA_TYPE_VIDEO:
             ret = avcodec_decode_video2(dec_ctx, frame, &got_frame, pkt);
@@ -2190,7 +2190,8 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
     if (s) print_str    ("codec_type", s);
     else   print_str_opt("codec_type", "unknown");
 #if FF_API_LAVF_AVCTX
-    print_q("codec_time_base", dec_ctx->time_base, '/');
+    if (dec_ctx)
+        print_q("codec_time_base", dec_ctx->time_base, '/');
 #endif
 
     /* print AVI/FourCC tag */