[soc]: r4011 - in libavfilter/diffs: 01_ffplay_filters.diff 02_ffmpeg_filters.diff
Author: stefano Date: Mon Jan 26 22:44:11 2009 New Revision: 4011 Log: Add checks for the validity of the parsed graph, fix crashes. Modified: libavfilter/diffs/01_ffplay_filters.diff libavfilter/diffs/02_ffmpeg_filters.diff Modified: libavfilter/diffs/01_ffplay_filters.diff ============================================================================== --- libavfilter/diffs/01_ffplay_filters.diff Mon Jan 26 22:28:54 2009 (r4010) +++ libavfilter/diffs/01_ffplay_filters.diff Mon Jan 26 22:44:11 2009 (r4011) @@ -211,7 +211,7 @@ Index: ffplay.c /* update the bitmap content */ SDL_UnlockYUVOverlay(vp->bmp); -@@ -1335,54 +1406,264 @@ +@@ -1335,54 +1406,266 @@ return queue_picture(is, src_frame, pts); } @@ -435,6 +435,8 @@ Index: ffplay.c + } + avfilter_graph_add_filter(graph, filt_src); + avfilter_graph_add_filter(graph, filt_out); ++ ++ if(avfilter_graph_check_validity(graph, NULL)) goto the_end; + if(avfilter_graph_config_formats(graph)) goto the_end; + if(avfilter_config_links(filt_out)) goto the_end; + @@ -507,7 +509,7 @@ Index: ffplay.c av_free(frame); return 0; } -@@ -2168,6 +2449,12 @@ +@@ -2168,6 +2451,12 @@ /* free all pictures */ for(i=0;i<VIDEO_PICTURE_QUEUE_SIZE; i++) { vp = &is->pictq[i]; @@ -520,7 +522,7 @@ Index: ffplay.c if (vp->bmp) { SDL_FreeYUVOverlay(vp->bmp); vp->bmp = NULL; -@@ -2505,6 +2792,9 @@ +@@ -2505,6 +2794,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" }, @@ -530,7 +532,7 @@ Index: ffplay.c { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" }, { NULL, }, }; -@@ -2553,7 +2843,9 @@ +@@ -2553,7 +2845,9 @@ avctx_opts[i]= avcodec_alloc_context2(i); } avformat_opts = av_alloc_format_context(); Modified: libavfilter/diffs/02_ffmpeg_filters.diff ============================================================================== --- libavfilter/diffs/02_ffmpeg_filters.diff Mon Jan 26 22:28:54 2009 (r4010) +++ libavfilter/diffs/02_ffmpeg_filters.diff Mon Jan 26 22:44:11 2009 (r4011) @@ -40,7 +40,7 @@ Index: ffmpeg.c } AVInputStream; typedef struct AVInputFile { -@@ -301,6 +318,174 @@ +@@ -301,6 +318,176 @@ static struct termios oldtty; #endif @@ -200,6 +200,8 @@ Index: ffmpeg.c + } + + /* configure all the filter links */ ++ if(avfilter_graph_check_validity(filt_graph_all, NULL)) ++ return -1; + if(avfilter_graph_config_formats(filt_graph_all)) + return -1; + if(avfilter_config_links(ist->out_video_filter)) @@ -215,7 +217,7 @@ Index: ffmpeg.c static void term_exit(void) { #if HAVE_TERMIOS_H -@@ -886,6 +1071,9 @@ +@@ -886,6 +1073,9 @@ if (nb_frames <= 0) return; @@ -225,7 +227,7 @@ Index: ffmpeg.c if (ost->video_crop) { if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) { av_log(NULL, AV_LOG_ERROR, "error cropping picture\n"); -@@ -897,6 +1085,7 @@ +@@ -897,6 +1087,7 @@ } else { formatted_picture = in_picture; } @@ -233,7 +235,7 @@ Index: ffmpeg.c final_picture = formatted_picture; padding_src = formatted_picture; -@@ -914,12 +1103,14 @@ +@@ -914,12 +1105,14 @@ } } @@ -248,7 +250,7 @@ Index: ffmpeg.c if (ost->video_pad) { av_picture_pad((AVPicture*)final_picture, (AVPicture *)padding_src, -@@ -1190,6 +1381,7 @@ +@@ -1190,6 +1383,7 @@ static short *samples= NULL; AVSubtitle subtitle, *subtitle_to_free; int got_subtitle; @@ -256,7 +258,7 @@ Index: ffmpeg.c if(ist->next_pts == AV_NOPTS_VALUE) ist->next_pts= ist->pts; -@@ -1307,6 +1499,15 @@ +@@ -1307,6 +1501,15 @@ &buffer_to_free); } @@ -272,7 +274,7 @@ Index: ffmpeg.c // preprocess audio (volume) if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) { if (audio_volume != 256) { -@@ -1328,10 +1529,16 @@ +@@ -1328,10 +1531,16 @@ if (pts > now) usleep(pts - now); } @@ -290,7 +292,7 @@ Index: ffmpeg.c for(i=0;i<nb_ostreams;i++) { int frame_size; -@@ -1354,6 +1561,9 @@ +@@ -1354,6 +1563,9 @@ do_audio_out(os, ost, ist, data_buf, data_size); break; case CODEC_TYPE_VIDEO: @@ -300,7 +302,7 @@ Index: ffmpeg.c do_video_out(os, ost, ist, &picture, &frame_size); if (vstats_filename && frame_size) do_video_stats(os, ost, frame_size); -@@ -1411,7 +1621,15 @@ +@@ -1411,7 +1623,15 @@ av_free_packet(&opkt); } } @@ -316,7 +318,7 @@ Index: ffmpeg.c av_free(buffer_to_free); /* XXX: allocate the subtitles in the codec ? */ if (subtitle_to_free) { -@@ -1842,10 +2060,21 @@ +@@ -1842,10 +2062,21 @@ fprintf(stderr, "Cannot get resampling context\n"); av_exit(1); } @@ -338,7 +340,7 @@ Index: ffmpeg.c break; case CODEC_TYPE_SUBTITLE: ost->encoding_needed = 1; -@@ -3835,6 +4064,9 @@ +@@ -3835,6 +4066,9 @@ #if CONFIG_VHOOK { "vhook", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)add_frame_hooker}, "insert video processing module", "module" }, #endif
participants (1)
-
stefano