OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e3fa35
)
Check codec_id and codec_type in avcodec_open(), based on 43_codec_type_mismatch...
author
Michael Niedermayer
<michaelni@gmx.at>
Tue, 22 Sep 2009 22:44:56 +0000
(22:44 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Tue, 22 Sep 2009 22:44:56 +0000
(22:44 +0000)
This is said to be able to lead to a stack based buffer overflow.
Originally committed as revision 19973 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/utils.c
patch
|
blob
|
history
diff --git
a/libavcodec/utils.c
b/libavcodec/utils.c
index
1ec039e
..
c31608d
100644
(file)
--- a/
libavcodec/utils.c
+++ b/
libavcodec/utils.c
@@
-481,7
+481,10
@@
int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
}
avctx->codec = codec;
- avctx->codec_id = codec->id;
+ if(avctx->codec_id != codec->id || avctx->codec_type != codec->type){
+ av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n");
+ goto end;
+ }
avctx->frame_number = 0;
if(avctx->codec->init){
ret = avctx->codec->init(avctx);