aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <stebbins@jetheaddev.com>2014-06-18 13:38:36 -0700
committerMichael Niedermayer <michaelni@gmx.at>2014-06-30 17:31:38 +0200
commit066a4819cc1b5a7990daa74a5d3825ad783e7acf (patch)
treea1cad9d8166dadf7defff9d0c77dde16fd912d47
parentfc7da418ff5dc88bca2268a368908089ff8a0566 (diff)
downloadffmpeg-066a4819cc1b5a7990daa74a5d3825ad783e7acf.tar.gz
avcodec/pgssubdec: Bail out of decode_rle() if error and AV_EF_EXPLODE is set
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/pgssubdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 4e30c065eb..f353c4c17c 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++;
}
}