[FFmpeg-devel] [PATCH]lavc/fic: Be less verbose for invisible or empty cursor

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Mar 26 14:24:53 CET 2016


Hi!

Attached patch fixes ticket #5174, there seems to be nothing invalid about a 
cursor outside of the screen or an empty cursor.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 7d698f0..3b5cb29 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -309,7 +309,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR_INVALIDDATA;
     }
 
-    if (!tsize)
+    if (!tsize || !AV_RL16(src + 37) || !AV_RL16(src + 39))
         skip_cursor = 1;
 
     if (!skip_cursor && tsize < 32) {
@@ -322,7 +322,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
     cur_x = AV_RL16(src + 33);
     cur_y = AV_RL16(src + 35);
     if (!skip_cursor && (cur_x > avctx->width || cur_y > avctx->height)) {
-        av_log(avctx, AV_LOG_WARNING,
+        av_log(avctx, AV_LOG_DEBUG,
                "Invalid cursor position: (%d,%d). Skipping cusor.\n",
                cur_x, cur_y);
         skip_cursor = 1;


More information about the ffmpeg-devel mailing list