aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msrle.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-06 04:01:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 18:16:20 +0200
commita61998e4f4e1af2d10856ac99f0f8e7a3d56b4d6 (patch)
tree4521bc34faead4348a7f1a1d5fa7383a2f04ca4f /libavcodec/msrle.c
parente5546d48717f59d630102ddbff413c06f6c0ea54 (diff)
downloadffmpeg-a61998e4f4e1af2d10856ac99f0f8e7a3d56b4d6.tar.gz
avcodec/msrle: check return code for success before use
The check is possibly redundant, but better to check for errors that dont occur than to skip the check and crash Fixes CID1197060 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 754f84663e8b3a88fa2e953b195d59230393fb8d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r--libavcodec/msrle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index a836e33cbe..c1498b544d 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -118,6 +118,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
int i, j;
+ if (linesize < 0)
+ return linesize;
+
for (i = 0; i < avctx->height; i++) {
if (avctx->bits_per_coded_sample == 4) {
for (j = 0; j < avctx->width - 1; j += 2) {