[Ffmpeg-devel] [PATCH] avpicture_get_size negative return value not caught
Reimar Döffinger
Reimar.Doeffinger
Wed Apr 19 17:03:21 CEST 2006
Hello,
seems obvious, but since I usually miss something...
libavcodec/imgconvert.c, avpicture_alloc line 1950,
avpicture_get_size returns -1 on error, but this will not be noticed due
to size being declared as unsigned. Have not encountered a case where
this causes problems, but still.
Attached patch okay?
Greetings,
Reimar D?ffinger
-------------- next part --------------
Index: libavcodec/imgconvert.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/imgconvert.c,v
retrieving revision 1.64
diff -u -r1.64 imgconvert.c
--- libavcodec/imgconvert.c 10 Apr 2006 07:45:29 -0000 1.64
+++ libavcodec/imgconvert.c 19 Apr 2006 14:59:56 -0000
@@ -1944,7 +1944,7 @@
int avpicture_alloc(AVPicture *picture,
int pix_fmt, int width, int height)
{
- unsigned int size;
+ int size;
void *ptr;
size = avpicture_get_size(pix_fmt, width, height);
More information about the ffmpeg-devel
mailing list