summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-06 04:01:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-04-06 04:01:24 +0200
commit754f84663e8b3a88fa2e953b195d59230393fb8d (patch)
treeb43da7362bc5a30dc8e4f5767ad60f6b0e936583
parentf87b3d552394cd03c1e9f180553d41600c575c69 (diff)
downloadffmpeg-754f84663e8b3a88fa2e953b195d59230393fb8d.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>
-rw-r--r--libavcodec/msrle.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 750e54ae99..9f0cac61e3 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -116,6 +116,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) {