Author: stefano
Date: Thu Oct  2 22:48:41 2008
New Revision: 3757

Log:
Fix a crash when using the rawvideo decoder in ffplay.

The rawvideo decoder uses the packet data to set the data in the
output AVFrame, so when the packet containing the data was released in
get_video_frame(), then the AVFrame data was released as well, and
when accessed caused a crash.


Modified:
   libavfilter/diffs/01_ffplay_filters.diff

Modified: libavfilter/diffs/01_ffplay_filters.diff
==============================================================================
--- libavfilter/diffs/01_ffplay_filters.diff    (original)
+++ libavfilter/diffs/01_ffplay_filters.diff    Thu Oct  2 22:48:41 2008
@@ -210,7 +210,7 @@ Index: ffplay.c
          /* update the bitmap content */
          SDL_UnlockYUVOverlay(vp->bmp);
  
-@@ -1332,54 +1403,253 @@
+@@ -1332,54 +1403,256 @@
      return queue_picture(is, src_frame, pts);
  }
  
@@ -247,7 +247,10 @@ Index: ffplay.c
 +        /* put pts into units of 1/AV_TIME_BASE */
 +    *pts = AV_TIME_BASE * (*pts) * is->video_st->time_base.num /
 +        is->video_st->time_base.den;
-+    av_free_packet(pkt);
++
++    /* rawvideo decoder uses the packet data to set the data in the output 
AVFrame */
++    if (is->video_st->codec->codec->id != CODEC_ID_RAWVIDEO)
++      av_free_packet(pkt);
 +    if(got_picture)
 +        return 1;
 +    return 0;
@@ -495,7 +498,7 @@ Index: ffplay.c
      av_free(frame);
      return 0;
  }
-@@ -2156,6 +2426,12 @@
+@@ -2156,6 +2429,12 @@
      /* free all pictures */
      for(i=0;i<VIDEO_PICTURE_QUEUE_SIZE; i++) {
          vp = &is->pictq[i];
@@ -508,7 +511,7 @@ Index: ffplay.c
          if (vp->bmp) {
              SDL_FreeYUVOverlay(vp->bmp);
              vp->bmp = NULL;
-@@ -2493,6 +2769,9 @@
+@@ -2493,6 +2772,9 @@
      { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set 
error concealment options",  "bit_mask" },
      { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set 
audio-video sync. type (type=audio/video/ext)", "type" },
      { "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, 
"thread count", "count" },
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to