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 754f84663e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-04-06 04:01:24 +02:00
parent e5546d4871
commit a61998e4f4

View File

@@ -118,6 +118,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
uint8_t *buf = avpkt->data + (avctx->height-1)*istride; uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
int i, j; int i, j;
if (linesize < 0)
return linesize;
for (i = 0; i < avctx->height; i++) { for (i = 0; i < avctx->height; i++) {
if (avctx->bits_per_coded_sample == 4) { if (avctx->bits_per_coded_sample == 4) {
for (j = 0; j < avctx->width - 1; j += 2) { for (j = 0; j < avctx->width - 1; j += 2) {