[FFmpeg-cvslog] dxa: check reference frame availability before use.
Michael Niedermayer
git at videolan.org
Fri Nov 30 22:38:31 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 30 20:58:26 2012 +0100| [7205e896a1ceb0e5c0256ed9cc1f69cf1fe664d4] | committer: Michael Niedermayer
dxa: check reference frame availability before use.
Fix 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=7205e896a1ceb0e5c0256ed9cc1f69cf1fe664d4
---
libavcodec/dxa.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index d43e113..cf8ce0c 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -270,6 +270,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
case 13:
c->pic.key_frame = 0;
c->pic.pict_type = AV_PICTURE_TYPE_P;
+ if (!c->prev.data[0]) {
+ av_log(avctx, AV_LOG_ERROR, "Missing reference frame\n");
+ return AVERROR_INVALIDDATA;
+ }
decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]);
break;
default:
More information about the ffmpeg-cvslog
mailing list