[FFmpeg-cvslog] dxa: dont try to use the previous frame if there is none.
Michael Niedermayer
git at videolan.org
Thu Nov 15 01:57:09 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov 15 00:42:49 2012 +0100| [12eb2fd5394813a6119912b22f5dfc17b4a6b4a0] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=12eb2fd5394813a6119912b22f5dfc17b4a6b4a0
---
libavcodec/dxa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index 13b63df..d43e113 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;
More information about the ffmpeg-cvslog
mailing list