[FFmpeg-cvslog] ffmpeg: check debug scanf() return value.

Michael Niedermayer git at videolan.org
Fri Nov 11 04:36:39 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 11 04:05:25 2011 +0100| [ec3c9a30203b1313683a473b3fa0fe9ceab57421] | committer: Michael Niedermayer

ffmpeg: check debug scanf() return value.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ec3c9a30203b1313683a473b3fa0fe9ceab57421
---

 ffmpeg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 8896b0c..6af3619 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2575,7 +2575,8 @@ static int transcode(OutputFile *output_files, int nb_output_files,
                     while(debug & (FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would just crash
                         debug += debug;
                 }else
-                    scanf("%d", &debug);
+                    if(scanf("%d", &debug)!=1)
+                        fprintf(stderr,"error parsing debug value\n");
                 for(i=0;i<nb_input_streams;i++) {
                     input_streams[i].st->codec->debug = debug;
                 }



More information about the ffmpeg-cvslog mailing list