aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorNikolas Bowe <nbowe@google.com>2018-07-30 17:22:02 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-28 02:22:42 +0200
commitc90457a95ee8c81617ec6227784780b691ad3061 (patch)
tree9a3c293acf8ec54f2df44683f81d7199a4c3daac /libavcodec
parent7abc4445f911a4264876d45d2f905ea2475fbfb9 (diff)
downloadffmpeg-c90457a95ee8c81617ec6227784780b691ad3061.tar.gz
lavc/svq3: Fix regression decoding some files.
Fixes some SVQ3 encoded files which fail to decode correctly after 6d6faa2a2d. These files exhibit lots of artifacts and logs show "Media key encryption is not implemented". However they decode without artifacts before 6d6faa2a2d. The attatched patch allows these files to successfully decode, but also reject media key files. Tested on the files in #6094 and http://samples.mplayerhq.hu/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5aeb3b008080d8d4a38f245d557dbc9bd6c36dcf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/svq3.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index a937b2f951..5d89921323 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1064,16 +1064,15 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
av_log(s->avctx, AV_LOG_ERROR, "illegal slice type %u \n", slice_id);
return -1;
}
- if (get_bits1(&s->gb_slice)) {
- avpriv_report_missing_feature(s->avctx, "Media key encryption");
- return AVERROR_PATCHWELCOME;
- }
s->slice_type = ff_h264_golomb_to_pict_type[slice_id];
if ((header & 0x9F) == 2) {
- i = (s->mb_num < 64) ? 5 : av_log2(s->mb_num - 1);
+ i = (s->mb_num < 64) ? 6 : (1 + av_log2(s->mb_num - 1));
get_bits(&s->gb_slice, i);
+ } else if (get_bits1(&s->gb_slice)) {
+ avpriv_report_missing_feature(s->avctx, "Media key encryption");
+ return AVERROR_PATCHWELCOME;
}
s->slice_num = get_bits(&s->gb_slice, 8);