OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58950ca
)
mjpeg_decode_dc: check code before using it in get_xbits()
author
Michael Niedermayer
<michaelni@gmx.at>
Sat, 29 Jun 2013 23:01:24 +0000
(
01:01
+0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sat, 29 Jun 2013 23:35:22 +0000
(
01:35
+0200)
Fixes undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mjpegdec.c
patch
|
blob
|
history
diff --git
a/libavcodec/mjpegdec.c
b/libavcodec/mjpegdec.c
index
ef8e1c6
..
97a9ac9
100644
(file)
--- a/
libavcodec/mjpegdec.c
+++ b/
libavcodec/mjpegdec.c
@@
-493,7
+493,7
@@
static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)
{
int code;
code = get_vlc2(&s->gb, s->vlcs[0][dc_index].table, 9, 2);
- if (code < 0) {
+ if (code < 0
|| code > 16
) {
av_log(s->avctx, AV_LOG_WARNING,
"mjpeg_decode_dc: bad vlc: %d:%d (%p)\n",
0, dc_index, &s->vlcs[0][dc_index]);