[FFmpeg-cvslog] avcodec/pgssubdec: Bail out of decode_rle() if error and AV_EF_EXPLODE is set

John Stebbins git at videolan.org
Mon Jun 30 18:10:40 CEST 2014


ffmpeg | branch: master | John Stebbins <stebbins at jetheaddev.com> | Wed Jun 18 13:38:36 2014 -0700| [066a4819cc1b5a7990daa74a5d3825ad783e7acf] | committer: Michael Niedermayer

avcodec/pgssubdec: Bail out of decode_rle() if error and AV_EF_EXPLODE is set

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=066a4819cc1b5a7990daa74a5d3825ad783e7acf
---

 libavcodec/pgssubdec.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 4e30c06..f353c4c 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -150,9 +150,13 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitleRect *rect,
              * New Line. Check if correct pixels decoded, if not display warning
              * and adjust bitmap pointer to correct new line position.
              */
-            if (pixel_count % rect->w > 0)
+            if (pixel_count % rect->w > 0) {
                 av_log(avctx, AV_LOG_ERROR, "Decoded %d pixels, when line should be %d pixels\n",
                        pixel_count % rect->w, rect->w);
+                if (avctx->err_recognition & AV_EF_EXPLODE) {
+                    return AVERROR_INVALIDDATA;
+                }
+            }
             line_count++;
         }
     }



More information about the ffmpeg-cvslog mailing list