aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-08-18 23:37:27 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-08-18 23:37:27 +0200
commit037af63b33730808a89ecb5eab156b44c5018f30 (patch)
tree78dbee55e6c7f1fa4ae39219ec21cff983ade869 /libavformat/mov.c
parentd73cbc22c5f2c305838d9867538cf4ad59c4035f (diff)
downloadffmpeg-037af63b33730808a89ecb5eab156b44c5018f30.tar.gz
Fix frame width and height for some targa_y216 samples.
Fixes ticket #2864.
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index cdc00eb511..ed5fb9563f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1025,6 +1025,20 @@ static int mov_read_avid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return mov_read_extradata(c, pb, atom, AV_CODEC_ID_AVUI);
}
+static int mov_read_targa_y216(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+ int ret = mov_read_extradata(c, pb, atom, AV_CODEC_ID_TARGA_Y216);
+
+ if (!ret && c->fc->nb_streams >= 1) {
+ AVCodecContext *avctx = c->fc->streams[c->fc->nb_streams-1]->codec;
+ if (avctx->extradata_size >= 40) {
+ avctx->height = AV_RB16(&avctx->extradata[36]);
+ avctx->width = AV_RB16(&avctx->extradata[38]);
+ }
+ }
+ return ret;
+}
+
static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVCodecContext *codec = c->fc->streams[c->fc->nb_streams-1]->codec;
@@ -2888,6 +2902,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('d','v','c','1'), mov_read_dvc1 },
{ MKTAG('s','b','g','p'), mov_read_sbgp },
{ MKTAG('u','u','i','d'), mov_read_uuid },
+{ MKTAG('C','i','n', 0x8e), mov_read_targa_y216 },
{ 0, NULL }
};