[FFmpeg-devel] [PATCH]Silence warnings if fic files contains a zero-length cursor

2014-11-02 Thread Carl Eugen Hoyos
Hi!

Attached patch fixes ticket #4072 for me.

Please comment, Carl Eugen
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 5615e69..adc8a25 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -308,7 +308,10 @@ static int fic_decode_frame(AVCodecContext *avctx, void 
*data,
 return AVERROR_INVALIDDATA;
 }
 
-if (tsize  32) {
+if (!tsize)
+skip_cursor = 1;
+
+if (!skip_cursor  tsize  32) {
 av_log(avctx, AV_LOG_WARNING,
Cursor data too small. Skipping cursor.\n);
 skip_cursor = 1;
@@ -317,14 +320,14 @@ static int fic_decode_frame(AVCodecContext *avctx, void 
*data,
 /* Cursor position. */
 cur_x = AV_RL16(src + 33);
 cur_y = AV_RL16(src + 35);
-if (cur_x  avctx-width || cur_y  avctx-height) {
+if (!skip_cursor  (cur_x  avctx-width || cur_y  avctx-height)) {
 av_log(avctx, AV_LOG_WARNING,
Invalid cursor position: (%d,%d). Skipping cusor.\n,
cur_x, cur_y);
 skip_cursor = 1;
 }
 
-if (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32) {
+if (!skip_cursor  (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32)) {
 av_log(avctx, AV_LOG_WARNING,
Invalid cursor size. Skipping cursor.\n);
 skip_cursor = 1;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Silence warnings if fic files contains a zero-length cursor

2014-11-02 Thread Michael Niedermayer
On Sun, Nov 02, 2014 at 11:06:11PM +0100, Carl Eugen Hoyos wrote:
 Hi!
 
 Attached patch fixes ticket #4072 for me.
 
 Please comment, Carl Eugen

  fic.c |9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)
 fc0e9306e01d102a7ed0eb7eaa8d0890498156d1  patchfic.diff
 diff --git a/libavcodec/fic.c b/libavcodec/fic.c

probably ok

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel