[FFmpeg-devel] [PATCH] libavformat/iff: print error message when DSDIFF compression type is not supported

Peter Ross pross at xvid.org
Fri Sep 26 07:44:46 CEST 2014


Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavformat/iff.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index 8e20303..e7c240c 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -285,7 +285,13 @@ static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
         case MKTAG('C','M','P','R'):
             if (size < 4)
                 return AVERROR_INVALIDDATA;
-            st->codec->codec_id = ff_codec_get_id(dsd_codec_tags, avio_rl32(pb));
+            tag = avio_rl32(pb);
+            st->codec->codec_id = ff_codec_get_id(dsd_codec_tags, tag);
+            if (!st->codec->codec_id) {
+                av_log(s, AV_LOG_ERROR, "'%c%c%c%c' compression is not supported\n",
+                    tag&0xFF, (tag>>8)&0xFF, (tag>>16)&0xFF, (tag>>24)&0xFF);
+                return AVERROR_PATCHWELCOME;
+            }
             break;
 
         case MKTAG('F','S',' ',' '):
-- 
1.9.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140926/a4a47d50/attachment.asc>


More information about the ffmpeg-devel mailing list