diff --git a/cmdutils.c b/cmdutils.c index 024c8019514bae2117cf035bb676c88ef970f03f..e90a9ee6fb9d0204c1d3d92e2643c46ea9f848b7 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -190,6 +190,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name) #if defined(_WIN32) && !defined(__MINGW32CE__) #include <windows.h> +#include <shellapi.h> /* Will be leaked on exit */ static char** win32_argv_utf8 = NULL; static int win32_argc = 0; diff --git a/configure b/configure index 8a318da6dba43cba2c85838451f3aa624dc64f32..abafd6ef93c55c657ace102e62562129500f416a 100755 --- a/configure +++ b/configure @@ -1253,6 +1253,7 @@ HAVE_LIST=" poll_h posix_memalign pthread_cancel + rdtsc round roundf sched_getaffinity @@ -2947,6 +2948,8 @@ check_cc <<EOF && enable inline_asm void foo(void) { __asm__ volatile ("" ::); } EOF +check_code cc intrin.h "__rdtsc()" && enable rdtsc + _restrict= for restrict_keyword in restrict __restrict__ __restrict; do check_cc <<EOF && _restrict=$restrict_keyword && break diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index cd73df6ad40e377e550bba59bf7b497d960f2212..cd84cc6ad5ad2ba5cd2a45d8041c103726938851 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -38,10 +38,6 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) int type, width, height; int len, ret = 0; - st = avformat_new_stream(s, NULL); - if (!st) - return AVERROR(ENOMEM); - pb = avio_alloc_context(buf, buf_size, 0, NULL, NULL, NULL, NULL); if (!pb) return AVERROR(ENOMEM); @@ -50,8 +46,11 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) type = avio_rb32(pb); if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) { av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type); - ret = AVERROR_INVALIDDATA; - goto fail; + if (s->error_recognition & AV_EF_EXPLODE) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + type = 0; } /* picture mimetype */ @@ -60,7 +59,8 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) avio_read(pb, mimetype, FFMIN(len, sizeof(mimetype) - 1)) != len) { av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached " "picture.\n"); - ret = AVERROR_INVALIDDATA; + if (s->error_recognition & AV_EF_EXPLODE) + ret = AVERROR_INVALIDDATA; goto fail; } mimetype[len] = 0; @@ -75,7 +75,8 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) if (id == CODEC_ID_NONE) { av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n", mimetype); - ret = AVERROR_INVALIDDATA; + if (s->error_recognition & AV_EF_EXPLODE) + ret = AVERROR_INVALIDDATA; goto fail; } @@ -88,7 +89,9 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) } if (avio_read(pb, desc, len) != len) { - ret = AVERROR(EIO); + av_log(s, AV_LOG_ERROR, "Error reading attached picture description.\n"); + if (s->error_recognition & AV_EF_EXPLODE) + ret = AVERROR(EIO); goto fail; } desc[len] = 0; @@ -102,7 +105,9 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) /* picture data */ len = avio_rb32(pb); if (len <= 0) { - ret = AVERROR_INVALIDDATA; + av_log(s, AV_LOG_ERROR, "Invalid attached picture size: %d.\n", len); + if (s->error_recognition & AV_EF_EXPLODE) + ret = AVERROR_INVALIDDATA; goto fail; } if (!(data = av_malloc(len))) { @@ -110,7 +115,15 @@ static int parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) goto fail; } if (avio_read(pb, data, len) != len) { - ret = AVERROR(EIO); + av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n"); + if (s->error_recognition & AV_EF_EXPLODE) + ret = AVERROR(EIO); + goto fail; + } + + st = avformat_new_stream(s, NULL); + if (!st) { + ret = AVERROR(ENOMEM); goto fail; } diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 216d4a2e5729c871df5c3041e21dca67aea10789..9ccd8f2d074061dd6e5ff3ff8256c3023258889a 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -130,6 +130,7 @@ const CodecMime ff_id3v2_mime_tags[] = { {"image/jpg", CODEC_ID_MJPEG}, {"image/png" , CODEC_ID_PNG}, {"image/tiff", CODEC_ID_TIFF}, + {"image/bmp", CODEC_ID_BMP}, {"", CODEC_ID_NONE}, }; diff --git a/libavutil/x86/timer.h b/libavutil/x86/timer.h index 62a111fdd390a4851babcd293196cc16c2ceb077..5969876bbe906aea2def7b181a23aee181cd60c5 100644 --- a/libavutil/x86/timer.h +++ b/libavutil/x86/timer.h @@ -23,6 +23,8 @@ #include <stdint.h> +#if HAVE_INLINE_ASM + #define AV_READ_TIME read_time static inline uint64_t read_time(void) @@ -32,4 +34,10 @@ static inline uint64_t read_time(void) return ((uint64_t)d << 32) + a; } +#elif HAVE_RDTSC + +#define AV_READ_TIME __rdtsc + +#endif /* HAVE_INLINE_ASM */ + #endif /* AVUTIL_X86_TIMER_H */