---
 libavcodec/pcx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c
index 837f268..05a8f7c 100644
--- a/libavcodec/pcx.c
+++ b/libavcodec/pcx.c
@@ -171,7 +171,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 
         if (buf_size < 769) {
             av_log(avctx, AV_LOG_ERROR, "File is too short\n");
-            ret = buf_size;
+            ret = avctx->err_recognition & AV_EF_EXPLODE ?
+                  AVERROR_INVALIDDATA : buf_size;
             goto end;
         }
 
@@ -187,7 +188,8 @@ static int pcx_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
         }
         if (*buf++ != 12) {
             av_log(avctx, AV_LOG_ERROR, "expected palette after image data\n");
-            ret = buf_size;
+            ret = avctx->err_recognition & AV_EF_EXPLODE ?
+                  AVERROR_INVALIDDATA : buf_size;
             goto end;
         }
     } else if (nplanes == 1) {   /* all packed formats, max. 16 colors */
-- 
1.8.1.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to