aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpeg.c
diff options
context:
space:
mode:
authorBurkhard Plaum <plaum@ipf.uni-stuttgart.de>2004-11-27 18:10:06 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-11-27 18:10:06 +0000
commit073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 (patch)
treec7a83b25f8d183bce584cc6ed66c57f8505ea7ec /libavcodec/mjpeg.c
parent8a6cb11455fcc89f506a44babdce1e021f6c592c (diff)
downloadffmpeg-073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1.tar.gz
Memory leak fix patch by (Burkhard Plaum <plaum >at< ipf.uni-stuttgart )dot( de>)
Originally committed as revision 3717 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mjpeg.c')
-rw-r--r--libavcodec/mjpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index a3743b754d..daa28d3540 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -844,7 +844,7 @@ typedef struct MJpegDecodeContext {
static int mjpeg_decode_dht(MJpegDecodeContext *s);
static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
- int nb_codes)
+ int nb_codes, int use_static)
{
uint8_t huff_size[256];
uint16_t huff_code[256];
@@ -852,7 +852,7 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_tab
memset(huff_size, 0, sizeof(huff_size));
build_huffman_codes(huff_size, huff_code, bits_table, val_table);
- return init_vlc(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2);
+ return init_vlc(vlc, 9, nb_codes, huff_size, 1, 1, huff_code, 2, 2, use_static);
}
static int mjpeg_decode_init(AVCodecContext *avctx)
@@ -882,10 +882,10 @@ static int mjpeg_decode_init(AVCodecContext *avctx)
s->first_picture = 1;
s->org_height = avctx->coded_height;
- build_vlc(&s->vlcs[0][0], bits_dc_luminance, val_dc_luminance, 12);
- build_vlc(&s->vlcs[0][1], bits_dc_chrominance, val_dc_chrominance, 12);
- build_vlc(&s->vlcs[1][0], bits_ac_luminance, val_ac_luminance, 251);
- build_vlc(&s->vlcs[1][1], bits_ac_chrominance, val_ac_chrominance, 251);
+ build_vlc(&s->vlcs[0][0], bits_dc_luminance, val_dc_luminance, 12, 0);
+ build_vlc(&s->vlcs[0][1], bits_dc_chrominance, val_dc_chrominance, 12, 0);
+ build_vlc(&s->vlcs[1][0], bits_ac_luminance, val_ac_luminance, 251, 0);
+ build_vlc(&s->vlcs[1][1], bits_ac_chrominance, val_ac_chrominance, 251, 0);
if (avctx->flags & CODEC_FLAG_EXTERN_HUFF)
{
@@ -1036,7 +1036,7 @@ static int mjpeg_decode_dht(MJpegDecodeContext *s)
free_vlc(&s->vlcs[class][index]);
dprintf("class=%d index=%d nb_codes=%d\n",
class, index, code_max + 1);
- if(build_vlc(&s->vlcs[class][index], bits_table, val_table, code_max + 1) < 0){
+ if(build_vlc(&s->vlcs[class][index], bits_table, val_table, code_max + 1, 0) < 0){
return -1;
}
}