summaryrefslogtreecommitdiff
path: root/libavcodec/dxa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-15 00:42:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-15 00:43:30 +0100
commit12eb2fd5394813a6119912b22f5dfc17b4a6b4a0 (patch)
treeecdb82d11a75adfcdb274c75be09d31bed0d00a7 /libavcodec/dxa.c
parente70144cba13db208877e3b64802fc8835c72e82d (diff)
downloadffmpeg-12eb2fd5394813a6119912b22f5dfc17b4a6b4a0.tar.gz
dxa: dont try to use the previous frame if there is none.
Fixes null pointer dereference. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dxa.c')
-rw-r--r--libavcodec/dxa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 13b63df926..d43e1134e2 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -256,7 +256,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->pic.key_frame = !(compr & 1);
c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
for(j = 0; j < avctx->height; j++){
- if(compr & 1){
+ if((compr & 1) && tmpptr){
for(i = 0; i < avctx->width; i++)
outptr[i] = srcptr[i] ^ tmpptr[i];
tmpptr += stride;