aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-27 03:45:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 16:51:09 +0200
commit2b45eab4c91366abdb8c4f1a6741f560396bb18c (patch)
treebbf43e3d021d0efc5d8a95ce8effd6f79a490db9
parentd89e5b20f2b9191b71e75c105fc7c7e13ca4d61a (diff)
downloadffmpeg-2b45eab4c91366abdb8c4f1a6741f560396bb18c.tar.gz
ffmpeg_filter: fix pointer to local outside scope
Fixes CID1206652 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 09b16619d33ddf93005060d0782f28a1c1cbb7f6) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffmpeg_filter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 461cc900fe..a33f0d497f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -42,12 +42,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
+ const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
+ const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
+
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
+ p = mjpeg_formats;
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
+ p =ljpeg_formats;
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {