Commit Graph

318 Commits

Author SHA1 Message Date
Michael Niedermayer
0c23ee1312 avcodec/mjpegdec: use mallocz for progressive blocks
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f849c599487_6828_mjpeg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-13 20:26:38 +01:00
Michael Niedermayer
6393038676 Merge commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5'
* commit 'e2274aa555f023e4f4e4819bf29b2d7e0adec7d5':
  mjpegdec: use the AVFrame API properly.

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 12:42:10 +01:00
anatoly
2fade10cb0 Add support for picture_ptr field in MJpegDecodeContext
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit e0e3b8b297)

Conflicts:

	libavcodec/jpeglsdec.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 12:24:50 +01:00
Anton Khirnov
e2274aa555 mjpegdec: use the AVFrame API properly. 2013-12-09 08:40:29 +01:00
Michael Niedermayer
6060234d43 avcodec/mjpegdec: check len in mjpeg_decode_app() more completely
Avoids len from becoming negative and causing assertion failure

Fixes: signal_sigabrt_7ffff7126425_5140_fd44dc63fa7bdd12ee34fc602231ef02.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 17:02:00 +01:00
Michael Niedermayer
64a0ed190e Merge commit '13207484bba8a8b78b40d5a22da8c9c555429089'
* commit '13207484bba8a8b78b40d5a22da8c9c555429089':
  mpeg4video_parser: stop using deprecated avcodec_set_dimensions
  mpeg12dec: stop using deprecated avcodec_set_dimensions
  mjpegdec: stop using deprecated avcodec_set_dimensions
  libvpxdec: stop using deprecated avcodec_set_dimensions

Conflicts:
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg4video_parser.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 15:14:52 +01:00
Anton Khirnov
2cd94ad5bf mjpegdec: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:15 +01:00
Michael Niedermayer
ee77140afa Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'
* commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2':
  cosmetics: Group .name and .long_name together in codec/format declarations

Conflicts:
	libavcodec/8svx.c
	libavcodec/alac.c
	libavcodec/cljr.c
	libavcodec/dnxhddec.c
	libavcodec/dnxhdenc.c
	libavcodec/dpxenc.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/ffv1dec.c
	libavcodec/flacdec.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/g726.c
	libavcodec/gif.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/h263dec.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopencore-amr.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libspeexenc.c
	libavcodec/libvo-amrwbenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg4videodec.c
	libavcodec/msmpeg4dec.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/proresdec_lgpl.c
	libavcodec/proresenc_kostya.c
	libavcodec/ra144enc.c
	libavcodec/rawdec.c
	libavcodec/rv10.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tta.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/wavpack.c
	libavcodec/xbmenc.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-04 12:34:23 +02:00
Diego Biurrun
b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Michael Niedermayer
7129935ed2 avcodec/mjpegdec: Fix ljpeg RCT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 02:00:15 +02:00
Michael Niedermayer
7fb2622456 avcodec/mjpegdec: rgba64 ljpeg support
Fixes Ticket2965

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-16 03:00:54 +02:00
Michael Niedermayer
1e4e0bd907 avcodec/mjpegdec: change error return value to be outside the 16bit range
Fixes part of Ticket2965

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-16 02:59:33 +02:00
Michael Niedermayer
b4a5fcb998 avcodec/mjpegdec: Fix rgb48 ljpeg
Fixes Ticket894

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-15 23:36:11 +02:00
Michael Niedermayer
6c07e41f43 avcodec/mjpegdec: check for malloc failure of blocks[] and last_nnz[]
Fixes null pointer dereference
Fixes Ticket2947

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-13 23:25:16 +02:00
Michael Niedermayer
64b6279d14 avcodec/mjpegdec: Support >8bpc color mjpeg
Fixes Ticket2939

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-11 02:45:17 +02:00
Michael Niedermayer
ce22820627 avcodec/mjpegdec: fix shift_output() with lowres
Fixes Ticket2940

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 01:46:14 +02:00
Michael Niedermayer
bcd1c20612 avcodec/mjpegdec: support >8bit in mjpeg_decode_scan_progressive_ac()
Fixes Ticket2812

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 02:33:10 +02:00
Michael Niedermayer
b155fb08b8 avcodec/mjpegdec: move shift_output() to its own function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 02:31:32 +02:00
Michael Niedermayer
c407c73457 avcodec/mjpegdec: 12bit Grayscale support
Fixes part of Ticket2812

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 01:19:37 +02:00
Michael Niedermayer
1deeb9437c avcodec/mjpegdec: Fix normal jpeg with bits < 8
Untested due to lack of testcase

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 01:19:37 +02:00
Michael Niedermayer
15071ed4fc avcodec/mjpegdec fix last_dc for bits != 8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-06 01:19:37 +02:00
Michael Niedermayer
b042712a87 avcodec/mjpegdec: Simplify masking in ljpeg_decode_yuv_scan()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 01:39:20 +02:00
Michael Niedermayer
b394ccfe47 avcodec/mjpegdec: fix rgb ljpeg prediction 5/6/7 with point_transform
untested due to lack of sample

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 01:39:20 +02:00
Michael Niedermayer
38f8640df8 avcodec/mjpegdec: fix yuv ljpeg prediction 5/6/7 with point transforms
Fixes Ticket2826

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 01:39:20 +02:00
Michael Niedermayer
cb026ac303 avcodec/mjpegdec: make "unknown colorspace" error more informative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 01:39:20 +02:00
Michael Niedermayer
61c68000ed avcodec/mjpegdec: Add some sanity checks to ljpeg_decode_rgb_scan()
These prevent the rgb ljpeg code from being run on parameters that it doesnt
support. No testcase available but it seems possible to trigger these.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 01:39:20 +02:00
Michael Niedermayer
49f5519345 Merge commit 'af11fa5409cc72fc45ca7f3527400beca10967b9'
* commit 'af11fa5409cc72fc45ca7f3527400beca10967b9':
  mjpegb: Detect changing number of planes in interlaced video

Conflicts:
	libavcodec/mjpegdec.c

See: ecc31630f9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-04 13:06:24 +02:00
Michael Niedermayer
af11fa5409 mjpegb: Detect changing number of planes in interlaced video
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:58:24 +03:00
Michael Niedermayer
16a0d75c76 avcodec/mjpegdec: fix overread in find_marker()
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-23 04:44:55 +02:00
Diego Biurrun
2a61592573 avcodec: Remove some commented-out debug cruft 2013-08-20 19:59:50 +02:00
Michael Niedermayer
dabfa80ce2 avcodec/mjpegdec: print a message when there was just a single field and no frame
Fixes ticket1915

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-14 19:16:38 +02:00
Thilo Borgmann
bb4e1b4cf9 avcodec/mjpegdec: Read EXIF metadata in JPEG input.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-13 00:30:34 +02:00
Carl Eugen Hoyos
ae4dc0b37a Set bits_per_raw_sample when decoding mjpeg / ljpeg.
The ljpeg decoder also supports gray images with
8 - 15 bits per component.
2013-07-28 17:13:01 +02:00
Michael Niedermayer
6db57fa8bc avcodec/mjpegdec: Support RGBA lpegs
Fixes Ticket896

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-25 00:32:44 +02:00
Michael Niedermayer
0ef40446a8 mjpegdec: print length too in APPx debug code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-11 16:28:55 +02:00
Michael Niedermayer
96747e6cbe mjpegdec: parse app-xfrm
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-11 16:08:49 +02:00
Michael Niedermayer
7afa68d37d mjpegdec: parse app-colr
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-11 16:08:36 +02:00
Michael Niedermayer
15cee5e562 mjpegdec: Fix used quant index for gbr
Fixes Ticket1651

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-11 02:31:58 +02:00
Michael Niedermayer
94e86ae15a mjpegdec: initialize source variables before gbr remap
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-11 02:31:58 +02:00
Michael Niedermayer
233177a4ec jpegdec: clear EOBRUN on restarts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 23:49:06 +02:00
Michael Niedermayer
1c032e94d0 jpegdec: give handle_rstn() a return code that indicates if restart did happen
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 23:45:31 +02:00
Michael Niedermayer
776155ca29 mjpeg_decode_scan: reset restart state
Fixes Ticket2082
Fixes progressive/refinement + restart jpegs

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 23:43:36 +02:00
Michael Niedermayer
afddf0d910 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mjpeg: Check the unescaped size for overflows

Conflicts:
	libavcodec/mjpegdec.c

See: a9456c7c5c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 14:11:38 +02:00
Michael Niedermayer
e3fb8ac956 Merge commit '7520d9779c6d30b385df5a0a42da508238076192'
* commit '7520d9779c6d30b385df5a0a42da508238076192':
  mjpeg: Move code out of else branch

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 13:50:55 +02:00
Luca Barbato
6765ee7b9c mjpeg: Check the unescaped size for overflows
And contextually check init_get_bits success and fix the reporting
message.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-06-30 08:48:51 +02:00
Luca Barbato
7520d9779c mjpeg: Move code out of else branch
Simplify the control flow and spare some vertical space.
2013-06-30 08:46:55 +02:00
Michael Niedermayer
6d6eabd399 mjpeg_decode_dc: check code before using it in get_xbits()
Fixes undefined behavior

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 01:35:22 +02:00
Michael Niedermayer
b60a65ee2d mjpegdec: fix AV_PIX_FMT_YUVJ411P handling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 12:56:12 +02:00
Michael Niedermayer
6ef7b6af6b Merge commit 'cfbd98abe82cfcb9984a18d08697251b72b110c8'
* commit 'cfbd98abe82cfcb9984a18d08697251b72b110c8':
  mjpegdec: validate parameters in mjpeg_decode_scan_progressive_ac

Conflicts:
	libavcodec/mjpegdec.c

See: 1f41cffe1e

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 12:01:37 +02:00
Michael Niedermayer
3b071a4390 Merge commit 'a030279a67ef883df8cf3707774656fa1be81078'
* commit 'a030279a67ef883df8cf3707774656fa1be81078':
  ljpeg: use the correct number of components in yuv

Conflicts:
	libavcodec/mjpegdec.c

See: b2e57eb5a3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-21 11:25:46 +02:00