Compare commits

...

34 Commits

Author SHA1 Message Date
Michael Niedermayer
61f55565fb rtpdec_asf: fix memleak
Based on a suggestion by Ronald S. Bultje
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a2b66a366d)
2011-09-07 16:57:15 +02:00
Michael Niedermayer
b6b46db9e4 Update for 0.7.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 15:18:29 +02:00
Michael Niedermayer
21d99be9dc Merge branch 'release/0.8' into release/0.7
* release/0.8: (21 commits)
  rtp: Fix integer underflow that could allow remote code execution.
  cavsdec: avoid possible crash with crafted input
  vf_scale: apply the same transform to the aspect during init that is applied per frame
  Fix memory corruption in case of memory allocation failure in av_probe_input_buffer()
  Make all option parsing functions match the function pointer type through which they are called.
  mjpegdec; even better RSTn skiping Fixes Ticket426
  jpegdec: better rst skiping Fixes Ticket426
  mpeg4: fix another packed divx issue. Fixes getting_stuck.avi
  mpeg4: adjust dummy frame threashold for packed divx. Fixes Ticket427
  configure: add missing CFLAGS to fix building on the HURD
  cavs: fix some crashes with invalid bitstreams
  jpegdec: actually search for and parse RSTn
  Fix compilation with --disable-avfilter. (cherry picked from commit 67a8251690)
  libavfilter: fix --enable-small
  0.8.2
  cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
  Fix possible crash when decoding mpeg streams.
  Bink: clip AC coefficients during dequantization.
  ffmpeg: fix passlogfile regression
  Fix several security issues in matroskadec.c (MSVR-11-0080).
  ...

Conflicts:
	Doxyfile
	RELEASE
	VERSION

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 15:04:56 +02:00
Michael Niedermayer
c2a2ad133e rtp: Fix integer underflow that could allow remote code execution.
Fixes MSVR-11-0088
Credit:  Jeong Wook Oh of Microsoft and Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba9a7e0d71)
2011-09-07 15:01:30 +02:00
Michael Niedermayer
b6187e48db cavsdec: avoid possible crash with crafted input
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f06c1c61e)
2011-09-07 14:59:29 +02:00
Michael Niedermayer
8af11e51f2 vf_scale: apply the same transform to the aspect during init that is applied per frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c8868f28e3)
2011-09-07 14:20:53 +02:00
Michael Niedermayer
f597825052 Fix memory corruption in case of memory allocation failure in av_probe_input_buffer()
Reported-by: Tanami Ohad
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 941bb552c6)
2011-09-07 14:20:53 +02:00
Jeff Downs
7d704f5127 Make all option parsing functions match the function pointer type through which they are called.
All option parsing functions now match the function pointer signature through
which they are called (int f(const char *, const char *), thereby working
reliably on all platforms.
Prefix all option processing functions with opt_
2011-09-07 08:56:04 +02:00
Jeff Downs
7b6b9be861 Make all option parsing functions match the function pointer type through which they are called.
All option parsing functions now match the function pointer signature through
which they are called (int f(const char *, const char *), thereby working
reliably on all platforms.
Prefix all option processing functions with opt_
2011-09-07 08:48:38 +02:00
Michael Niedermayer
374409eb1a mjpegdec; even better RSTn skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be7eed72c8)
2011-09-07 01:07:37 +02:00
Michael Niedermayer
a352fedb24 jpegdec: better rst skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-07 01:06:58 +02:00
Michael Niedermayer
c92068430d mpeg4: fix another packed divx issue.
Fixes getting_stuck.avi

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dbac85f8d)
2011-09-07 00:48:28 +02:00
Michael Niedermayer
274a5b7cdb mpeg4: adjust dummy frame threashold for packed divx.
Fixes Ticket427

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e7e1f1509)
2011-09-07 00:48:27 +02:00
Michael Niedermayer
eb975b1c8b mjpegdec; even better RSTn skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be7eed72c8)
2011-09-07 00:31:14 +02:00
Michael Niedermayer
84648d33ba jpegdec: better rst skiping
Fixes Ticket426

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 94c2478d90)
2011-09-07 00:31:14 +02:00
Michael Niedermayer
4b8a0b058d mpeg4: fix another packed divx issue.
Fixes getting_stuck.avi

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dbac85f8d)
2011-09-07 00:29:02 +02:00
Michael Niedermayer
1de90fd375 mpeg4: adjust dummy frame threashold for packed divx.
Fixes Ticket427

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e7e1f1509)
2011-09-07 00:29:02 +02:00
Michael Niedermayer
c8b37fd03d Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  configure: add missing CFLAGS to fix building on the HURD

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-26 01:55:20 +02:00
Pino Toscano
b37131f798 configure: add missing CFLAGS to fix building on the HURD
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f60d136637)
2011-08-25 22:47:06 +02:00
Reimar Döffinger
95345e942c Avoid crash due to ic being NULL if avformat_open_input fails.
This updates the code to match current master.
Should fix trac issue #410.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-08-23 19:47:19 +02:00
Michael Niedermayer
878a7d1573 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7:
  cavs: fix some crashes with invalid bitstreams
  jpegdec: actually search for and parse RSTn

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-21 22:44:58 +02:00
Mans Rullgard
bd968d260a cavs: fix some crashes with invalid bitstreams
This removes all valgrind-reported invalid writes with one
specific test file.

Fixes http://www.ocert.org/advisories/ocert-2011-002.html

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 4a71da0f3a)
2011-08-21 11:23:56 +02:00
Michael Niedermayer
00c5cf4beb jpegdec: actually search for and parse RSTn
Fixes decoding of MJPEG files produced by some UVC Logitec web cameras,
such as "Notebook Pro" and "HD C910".

References:
http://trac.videolan.org/vlc/ticket/4215
http://ffmpeg.org/trac/ffmpeg/ticket/267

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Reviewed-by: Kostya <kostya.shishkov@gmail.com>
(cherry picked from commit 8c0fa61a97)
2011-08-21 11:08:27 +02:00
Carl Eugen Hoyos
87757508ab Fix compilation with --disable-avfilter.
(cherry picked from commit 67a8251690)
2011-08-16 23:33:20 +02:00
Carl Eugen Hoyos
6a57021cf9 Fix compilation with --disable-avfilter.
(cherry picked from commit 67a8251690)
2011-08-16 23:32:06 +02:00
Michael Niedermayer
f66418afba libavfilter: fix --enable-small
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 633aa01f72)
2011-08-15 19:49:24 +02:00
Michael Niedermayer
f20f79307b libavfilter: fix --enable-small
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 633aa01f72)
2011-08-15 19:49:17 +02:00
Michael Niedermayer
d1bc77d86c 0.8.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:48:30 +02:00
Michael Niedermayer
91d5da9321 cavs: fix oCERT #2011-002 FFmpeg/libavcodec insufficient boundary check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 13:46:22 +02:00
Carl Eugen Hoyos
08ddfb77a1 Fix possible crash when decoding mpeg streams.
This reverts 2cf8355f98,
fixes ticket 329.
2011-08-04 11:49:52 +02:00
Reimar Döffinger
a0352d01e9 Bink: clip AC coefficients during dequantization.
Fixes artefacts with Neverwinter Nights WOTCLogo.bik
(http://drmccoy.de/zeugs/WOTCLogo.bik).
Fixes trac ticket #352.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 47b71eea09)
2011-08-04 11:45:28 +02:00
Michael Niedermayer
2ff36ef521 ffmpeg: fix passlogfile regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-28 18:32:26 +02:00
Michael Niedermayer
7e33a66c0e Fix several security issues in matroskadec.c (MSVR-11-0080).
Whitespace of the patch cleaned up by Aurel
Some of the issues have been reported by Steve Manzuik / Microsoft Vulnerability Research (MSVR)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 956c901c68)
2011-07-28 15:29:43 +02:00
Baptiste Coudurier
893cf1b1ae ffmpeg: fix prototypes of functions after the removal of OPT_FUNC2.
(cherry picked from commit 90a40b226a)
2011-07-27 22:52:36 +02:00
18 changed files with 113 additions and 58 deletions

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = 0.7.3 PROJECT_NUMBER = 0.7.4
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put. # base path where the generated documentation will be put.

View File

@@ -1 +1 @@
0.7.3 0.7.4

View File

@@ -1 +1 @@
0.7.3 0.7.4

View File

@@ -574,12 +574,13 @@ void show_banner(void)
print_all_libs_info(stderr, INDENT|SHOW_VERSION); print_all_libs_info(stderr, INDENT|SHOW_VERSION);
} }
void show_version(void) { int opt_version(const char *opt, const char *arg) {
printf("%s " FFMPEG_VERSION "\n", program_name); printf("%s " FFMPEG_VERSION "\n", program_name);
print_all_libs_info(stdout, SHOW_VERSION); print_all_libs_info(stdout, SHOW_VERSION);
return 0;
} }
void show_license(void) int opt_license(const char *opt, const char *arg)
{ {
printf( printf(
#if CONFIG_NONFREE #if CONFIG_NONFREE
@@ -646,9 +647,10 @@ void show_license(void)
program_name, program_name, program_name program_name, program_name, program_name
#endif #endif
); );
return 0;
} }
void show_formats(void) int opt_formats(const char *opt, const char *arg)
{ {
AVInputFormat *ifmt=NULL; AVInputFormat *ifmt=NULL;
AVOutputFormat *ofmt=NULL; AVOutputFormat *ofmt=NULL;
@@ -695,9 +697,10 @@ void show_formats(void)
name, name,
long_name ? long_name:" "); long_name ? long_name:" ");
} }
return 0;
} }
void show_codecs(void) int opt_codecs(const char *opt, const char *arg)
{ {
AVCodec *p=NULL, *p2; AVCodec *p=NULL, *p2;
const char *last_name; const char *last_name;
@@ -771,9 +774,10 @@ void show_codecs(void)
"even though both encoding and decoding are supported. For example, the h263\n" "even though both encoding and decoding are supported. For example, the h263\n"
"decoder corresponds to the h263 and h263p encoders, for file formats it is even\n" "decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
"worse.\n"); "worse.\n");
return 0;
} }
void show_bsfs(void) int opt_bsfs(const char *opt, const char *arg)
{ {
AVBitStreamFilter *bsf=NULL; AVBitStreamFilter *bsf=NULL;
@@ -781,9 +785,10 @@ void show_bsfs(void)
while((bsf = av_bitstream_filter_next(bsf))) while((bsf = av_bitstream_filter_next(bsf)))
printf("%s\n", bsf->name); printf("%s\n", bsf->name);
printf("\n"); printf("\n");
return 0;
} }
void show_protocols(void) int opt_protocols(const char *opt, const char *arg)
{ {
URLProtocol *up=NULL; URLProtocol *up=NULL;
@@ -799,9 +804,10 @@ void show_protocols(void)
up->url_write ? 'O' : '.', up->url_write ? 'O' : '.',
up->url_seek ? 'S' : '.', up->url_seek ? 'S' : '.',
up->name); up->name);
return 0;
} }
void show_filters(void) int opt_filters(const char *opt, const char *arg)
{ {
AVFilter av_unused(**filter) = NULL; AVFilter av_unused(**filter) = NULL;
@@ -810,9 +816,10 @@ void show_filters(void)
while ((filter = av_filter_next(filter)) && *filter) while ((filter = av_filter_next(filter)) && *filter)
printf("%-16s %s\n", (*filter)->name, (*filter)->description); printf("%-16s %s\n", (*filter)->name, (*filter)->description);
#endif #endif
return 0;
} }
void show_pix_fmts(void) int opt_pix_fmts(const char *opt, const char *arg)
{ {
enum PixelFormat pix_fmt; enum PixelFormat pix_fmt;
@@ -843,6 +850,7 @@ void show_pix_fmts(void)
pix_desc->nb_components, pix_desc->nb_components,
av_get_bits_per_pixel(pix_desc)); av_get_bits_per_pixel(pix_desc));
} }
return 0;
} }
int read_yesno(void) int read_yesno(void)

View File

@@ -62,7 +62,7 @@ void uninit_opts(void);
/** /**
* Trivial log callback. * Trivial log callback.
* Only suitable for show_help and similar since it lacks prefix handling. * Only suitable for opt_help and similar since it lacks prefix handling.
*/ */
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl); void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
@@ -177,50 +177,58 @@ void show_banner(void);
* Print the version of the program to stdout. The version message * Print the version of the program to stdout. The version message
* depends on the current versions of the repository and of the libav* * depends on the current versions of the repository and of the libav*
* libraries. * libraries.
* This option processing function does not utilize the arguments.
*/ */
void show_version(void); int opt_version(const char *opt, const char *arg);
/** /**
* Print the license of the program to stdout. The license depends on * Print the license of the program to stdout. The license depends on
* the license of the libraries compiled into the program. * the license of the libraries compiled into the program.
* This option processing function does not utilize the arguments.
*/ */
void show_license(void); int opt_license(const char *opt, const char *arg);
/** /**
* Print a listing containing all the formats supported by the * Print a listing containing all the formats supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_formats(void); int opt_formats(const char *opt, const char *arg);
/** /**
* Print a listing containing all the codecs supported by the * Print a listing containing all the codecs supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_codecs(void); int opt_codecs(const char *opt, const char *arg);
/** /**
* Print a listing containing all the filters supported by the * Print a listing containing all the filters supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_filters(void); int opt_filters(const char *opt, const char *arg);
/** /**
* Print a listing containing all the bit stream filters supported by the * Print a listing containing all the bit stream filters supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_bsfs(void); int opt_bsfs(const char *opt, const char *arg);
/** /**
* Print a listing containing all the protocols supported by the * Print a listing containing all the protocols supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_protocols(void); int opt_protocols(const char *opt, const char *arg);
/** /**
* Print a listing containing all the pixel formats supported by the * Print a listing containing all the pixel formats supported by the
* program. * program.
* This option processing function does not utilize the arguments.
*/ */
void show_pix_fmts(void); int opt_pix_fmts(const char *opt, const char *arg);
/** /**
* Return a positive value if a line read from standard input * Return a positive value if a line read from standard input

View File

@@ -1,13 +1,13 @@
{ "L", OPT_EXIT, {(void*)show_license}, "show license" }, { "L", OPT_EXIT, {(void*)opt_license}, "show license" },
{ "h", OPT_EXIT, {(void*)show_help}, "show help" }, { "h", OPT_EXIT, {(void*)opt_help}, "show help" },
{ "?", OPT_EXIT, {(void*)show_help}, "show help" }, { "?", OPT_EXIT, {(void*)opt_help}, "show help" },
{ "help", OPT_EXIT, {(void*)show_help}, "show help" }, { "help", OPT_EXIT, {(void*)opt_help}, "show help" },
{ "-help", OPT_EXIT, {(void*)show_help}, "show help" }, { "-help", OPT_EXIT, {(void*)opt_help}, "show help" },
{ "version", OPT_EXIT, {(void*)show_version}, "show version" }, { "version", OPT_EXIT, {(void*)opt_version}, "show version" },
{ "formats" , OPT_EXIT, {(void*)show_formats }, "show available formats" }, { "formats" , OPT_EXIT, {(void*)opt_formats }, "show available formats" },
{ "codecs" , OPT_EXIT, {(void*)show_codecs }, "show available codecs" }, { "codecs" , OPT_EXIT, {(void*)opt_codecs }, "show available codecs" },
{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit stream filters" }, { "bsfs" , OPT_EXIT, {(void*)opt_bsfs }, "show available bit stream filters" },
{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available protocols" }, { "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
{ "filters", OPT_EXIT, {(void*)show_filters }, "show available filters" }, { "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel formats" }, { "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" }, { "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },

1
configure vendored
View File

@@ -2537,6 +2537,7 @@ case $target_os in
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
;; ;;
gnu) gnu)
add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
;; ;;
qnx) qnx)
add_cppflags -D_QNX_SOURCE add_cppflags -D_QNX_SOURCE

View File

@@ -2946,7 +2946,7 @@ static int opt_frame_pix_fmt(const char *opt, const char *arg)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
} else { } else {
show_pix_fmts(); opt_pix_fmts(NULL, NULL);
ffmpeg_exit(0); ffmpeg_exit(0);
} }
return 0; return 0;
@@ -4077,16 +4077,18 @@ static void parse_matrix_coeffs(uint16_t *dest, const char *str)
} }
} }
static void opt_inter_matrix(const char *opt, const char *arg) static int opt_inter_matrix(const char *opt, const char *arg)
{ {
inter_matrix = av_mallocz(sizeof(uint16_t) * 64); inter_matrix = av_mallocz(sizeof(uint16_t) * 64);
parse_matrix_coeffs(inter_matrix, arg); parse_matrix_coeffs(inter_matrix, arg);
return 0;
} }
static void opt_intra_matrix(const char *opt, const char *arg) static int opt_intra_matrix(const char *opt, const char *arg)
{ {
intra_matrix = av_mallocz(sizeof(uint16_t) * 64); intra_matrix = av_mallocz(sizeof(uint16_t) * 64);
parse_matrix_coeffs(intra_matrix, arg); parse_matrix_coeffs(intra_matrix, arg);
return 0;
} }
static void show_usage(void) static void show_usage(void)
@@ -4096,7 +4098,7 @@ static void show_usage(void)
printf("\n"); printf("\n");
} }
static void show_help(void) static int opt_help(const char *opt, const char *arg)
{ {
AVCodec *c; AVCodec *c;
AVOutputFormat *oformat = NULL; AVOutputFormat *oformat = NULL;
@@ -4151,6 +4153,7 @@ static void show_help(void)
} }
av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0); av_opt_show2(sws_opts, NULL, AV_OPT_FLAG_ENCODING_PARAM|AV_OPT_FLAG_DECODING_PARAM, 0);
return 0;
} }
static int opt_target(const char *opt, const char *arg) static int opt_target(const char *opt, const char *arg)
@@ -4381,11 +4384,13 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
{ {
} }
static void opt_passlogfile(const char *opt, const char *arg) static int opt_passlogfile(const char *opt, const char *arg)
{ {
pass_logfilename_prefix = arg; pass_logfilename_prefix = arg;
#if CONFIG_LIBX264_ENCODER #if CONFIG_LIBX264_ENCODER
opt_default("passlogfile", arg); return opt_default("passlogfile", arg);
#else
return 0;
#endif #endif
} }

View File

@@ -212,7 +212,7 @@ typedef struct VideoState {
int refresh; int refresh;
} VideoState; } VideoState;
static void show_help(void); static int opt_help(const char *opt, const char *arg);
/* options specified by the user */ /* options specified by the user */
static AVInputFormat *file_iformat; static AVInputFormat *file_iformat;
@@ -1779,8 +1779,10 @@ static int video_thread(void *arg)
if (ret < 0) goto the_end; if (ret < 0) goto the_end;
#if CONFIG_AVFILTER
if (!picref) if (!picref)
continue; continue;
#endif
pts = pts_int*av_q2d(is->video_st->time_base); pts = pts_int*av_q2d(is->video_st->time_base);
@@ -2950,7 +2952,7 @@ static void show_usage(void)
printf("\n"); printf("\n");
} }
static void show_help(void) static int opt_help(const char *opt, const char *arg)
{ {
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
@@ -2982,6 +2984,7 @@ static void show_help(void)
"down/up seek backward/forward 1 minute\n" "down/up seek backward/forward 1 minute\n"
"mouse click seek to percentage in file corresponding to fraction of width\n" "mouse click seek to percentage in file corresponding to fraction of width\n"
); );
return 0;
} }
/* Called from the main */ /* Called from the main */

View File

@@ -353,7 +353,7 @@ static int opt_input_file(const char *opt, const char *arg)
return 0; return 0;
} }
static void show_help(void) static int opt_help(const char *opt, const char *arg)
{ {
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
show_usage(); show_usage();
@@ -361,6 +361,7 @@ static void show_help(void)
printf("\n"); printf("\n");
av_opt_show2(avformat_opts, NULL, av_opt_show2(avformat_opts, NULL,
AV_OPT_FLAG_DECODING_PARAM, 0); AV_OPT_FLAG_DECODING_PARAM, 0);
return 0;
} }
static void opt_pretty(void) static void opt_pretty(void)

View File

@@ -4662,12 +4662,13 @@ static void opt_debug(void)
logfilename[0] = '-'; logfilename[0] = '-';
} }
static void show_help(void) static int opt_help(const char *opt, const char *arg)
{ {
printf("usage: ffserver [options]\n" printf("usage: ffserver [options]\n"
"Hyper fast multi format Audio/Video streaming server\n"); "Hyper fast multi format Audio/Video streaming server\n");
printf("\n"); printf("\n");
show_help_options(options, "Main options:\n", 0, 0); show_help_options(options, "Main options:\n", 0, 0);
return 0;
} }
static const OptionDef options[] = { static const OptionDef options[] = {

View File

@@ -125,6 +125,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
level_code = get_ue_code(gb,r->golomb_order); level_code = get_ue_code(gb,r->golomb_order);
if(level_code >= ESCAPE_CODE) { if(level_code >= ESCAPE_CODE) {
run = ((level_code - ESCAPE_CODE) >> 1) + 1; run = ((level_code - ESCAPE_CODE) >> 1) + 1;
if(run > 64)
return -1;
esc_code = get_ue_code(gb,esc_golomb_order); esc_code = get_ue_code(gb,esc_golomb_order);
level = esc_code + (run > r->max_run ? 1 : r->level_add[run]); level = esc_code + (run > r->max_run ? 1 : r->level_add[run]);
while(level > r->inc_limit) while(level > r->inc_limit)
@@ -164,7 +166,7 @@ static inline int decode_residual_inter(AVSContext *h) {
/* get coded block pattern */ /* get coded block pattern */
int cbp= get_ue_golomb(&h->s.gb); int cbp= get_ue_golomb(&h->s.gb);
if(cbp > 63){ if(cbp > 63U){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n"); av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
return -1; return -1;
} }
@@ -190,7 +192,8 @@ static inline int decode_residual_inter(AVSContext *h) {
static int decode_mb_i(AVSContext *h, int cbp_code) { static int decode_mb_i(AVSContext *h, int cbp_code) {
GetBitContext *gb = &h->s.gb; GetBitContext *gb = &h->s.gb;
int block, pred_mode_uv; unsigned pred_mode_uv;
int block;
uint8_t top[18]; uint8_t top[18];
uint8_t *left = NULL; uint8_t *left = NULL;
uint8_t *d; uint8_t *d;
@@ -223,7 +226,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
/* get coded block pattern */ /* get coded block pattern */
if(h->pic_type == AV_PICTURE_TYPE_I) if(h->pic_type == AV_PICTURE_TYPE_I)
cbp_code = get_ue_golomb(gb); cbp_code = get_ue_golomb(gb);
if(cbp_code > 63){ if(cbp_code > 63U){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n"); av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
return -1; return -1;
} }
@@ -446,6 +449,8 @@ static inline int check_for_slice(AVSContext *h) {
if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) { if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
skip_bits_long(gb,24+align); skip_bits_long(gb,24+align);
h->stc = get_bits(gb,8); h->stc = get_bits(gb,8);
if (h->stc >= h->mb_height)
return 0;
decode_slice_header(h,gb); decode_slice_header(h,gb);
return 1; return 1;
} }
@@ -660,7 +665,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
buf_end = buf + buf_size; buf_end = buf + buf_size;
for(;;) { for(;;) {
buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc); buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
if(stc & 0xFFFFFE00) if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
return FFMAX(0, buf_ptr - buf - s->parse_context.last_index); return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
input_size = (buf_end - buf_ptr)*8; input_size = (buf_end - buf_ptr)*8;
switch(stc) { switch(stc) {

View File

@@ -380,7 +380,7 @@ uint64_t time= rdtsc();
retry: retry:
if(s->divx_packed && s->xvid_build>=0 && s->bitstream_buffer_size){ if(s->divx_packed && s->bitstream_buffer_size){
int i; int i;
for(i=0; i<buf_size-3; i++){ for(i=0; i<buf_size-3; i++){
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){ if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1){
@@ -689,7 +689,7 @@ frame_end:
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3); int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
int startcode_found=0; int startcode_found=0;
if(buf_size - current_pos > 5){ if(buf_size - current_pos > 7){
int i; int i;
for(i=current_pos; i<buf_size-4; i++){ for(i=current_pos; i<buf_size-4; i++){
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){ if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){

View File

@@ -881,14 +881,19 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, i
} }
} }
if (s->restart_interval && show_bits(&s->gb, 8) == 0xFF){/* skip RSTn */ if (s->restart_interval) --s->restart_count;
--s->restart_count; i= 8+((-get_bits_count(&s->gb))&7);
if (s->restart_interval && show_bits(&s->gb, i) == (1<<i)-1){ /* skip RSTn */
int pos= get_bits_count(&s->gb);
align_get_bits(&s->gb); align_get_bits(&s->gb);
while(show_bits(&s->gb, 8) == 0xFF) while(show_bits(&s->gb, 8) == 0xFF)
skip_bits(&s->gb, 8); skip_bits(&s->gb, 8);
skip_bits(&s->gb, 8); if((get_bits(&s->gb, 8)&0xF8) == 0xD0){
for (i=0; i<nb_components; i++) /* reset dc */ for (i=0; i<nb_components; i++) /* reset dc */
s->last_dc[i] = 1024; s->last_dc[i] = 1024;
}else{
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
}
} }
} }
} }

View File

@@ -345,8 +345,8 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
#define DEFINE_LUT_FILTER(name_, description_, init_) \ #define DEFINE_LUT_FILTER(name_, description_, init_) \
AVFilter avfilter_vf_##name_ = { \ AVFilter avfilter_vf_##name_ = { \
.name = NULL_IF_CONFIG_SMALL(#name_), \ .name = #name_, \
.description = description_, \ .description = NULL_IF_CONFIG_SMALL(description_), \
.priv_size = sizeof(LutContext), \ .priv_size = sizeof(LutContext), \
\ \
.init = init_, \ .init = init_, \

View File

@@ -232,6 +232,11 @@ static int config_props(AVFilterLink *outlink)
if (!scale->sws) if (!scale->sws)
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (inlink->sample_aspect_ratio.num){
outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio);
} else
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
return 0; return 0;
fail: fail:

View File

@@ -233,8 +233,14 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
int cur_len = start_off + len_off - off; int cur_len = start_off + len_off - off;
int prev_len = out_len; int prev_len = out_len;
void *newbuf;
out_len += cur_len; out_len += cur_len;
asf->buf = av_realloc(asf->buf, out_len); if(FFMIN(cur_len, len - off)<0)
return -1;
newbuf = av_realloc(asf->buf, out_len);
if(!newbuf)
return -1;
asf->buf= newbuf;
memcpy(asf->buf + prev_len, buf + off, memcpy(asf->buf + prev_len, buf + off,
FFMIN(cur_len, len - off)); FFMIN(cur_len, len - off));
avio_skip(pb, cur_len); avio_skip(pb, cur_len);

View File

@@ -537,7 +537,8 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
else else
ic->pb = pb; ic->pb = pb;
err = avformat_open_input(&ic, filename, fmt, &opts); if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0)
goto fail;
*ic_ptr = ic; *ic_ptr = ic;
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above
@@ -595,13 +596,19 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) { probe_size = FFMIN(probe_size<<1, FFMAX(max_probe_size, probe_size+1))) {
int ret, score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX/4 : 0; int ret, score = probe_size < max_probe_size ? AVPROBE_SCORE_MAX/4 : 0;
int buf_offset = (probe_size == PROBE_BUF_MIN) ? 0 : probe_size>>1; int buf_offset = (probe_size == PROBE_BUF_MIN) ? 0 : probe_size>>1;
void *buftmp;
if (probe_size < offset) { if (probe_size < offset) {
continue; continue;
} }
/* read probe data */ /* read probe data */
buf = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE); buftmp = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE);
if(!buftmp){
av_free(buf);
return AVERROR(ENOMEM);
}
buf=buftmp;
if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) { if ((ret = avio_read(pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
/* fail if error was not end of file, otherwise, lower score */ /* fail if error was not end of file, otherwise, lower score */
if (ret != AVERROR_EOF) { if (ret != AVERROR_EOF) {