summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 95dc1ee7ad..9532213023 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -200,6 +200,14 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
if (ret < 0)
return ret;
+ if (pkt.size >= 8 && id != AV_CODEC_ID_BMP) {
+ if (AV_RB64(pkt.data) == 0x89504e470d0a1a0a) {
+ id = AV_CODEC_ID_PNG;
+ } else {
+ id = AV_CODEC_ID_MJPEG;
+ }
+ }
+
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
st->attached_pic = pkt;