OSDN Git Service

tiff: set the correct return value when check_size() fails
authorVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 12 Dec 2014 18:25:58 +0000 (18:25 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 15 Dec 2014 14:46:34 +0000 (15:46 +0100)
Only one instance affected and solved as other occurences.

libavcodec/tiffenc.c

index e17208a..f273492 100644 (file)
@@ -319,8 +319,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     s->buf       = &ptr;
     s->buf_size  = pkt->size;
 
-    if (check_size(s, 8))
+    if (check_size(s, 8)) {
+        ret = AVERROR(EINVAL);
         goto fail;
+    }
 
     // write header
     bytestream_put_le16(&ptr, 0x4949);