On Sat, Mar 26, 2016 at 10:51 AM, Janne Grunau <[email protected]> wrote:
> On 2016-03-26 09:46:01 +0100, Vittorio Giovara wrote:
>> The first byte contains compression level together with keyframe status.
>> When a frame is not interpreted correctly, its data is summed to the
>> reference, and would degrade over time, producing an incorrect result.
>>
>> Signed-off-by: Vittorio Giovara <[email protected]>
>> ---
>>  libavcodec/screenpresso.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c
>> index 9635b60..8519a2d 100644
>> --- a/libavcodec/screenpresso.c
>> +++ b/libavcodec/screenpresso.c
>> @@ -115,11 +115,9 @@ static int screenpresso_decode_frame(AVCodecContext 
>> *avctx, void *data,
>>          return AVERROR_INVALIDDATA;
>>      }
>>
>> -    /* Basic sanity check, but not really harmful */
>> -    if (avpkt->data[0] != 0x72 && avpkt->data[0] != 0x73)
>> -        av_log(avctx, AV_LOG_WARNING, "Unknown header 0x%02X\n", 
>> avpkt->data[0]);
>> -
>> -    keyframe = (avpkt->data[0] == 0x73);
>> +    /* Compression level and keyframe information */
>> +    av_log(avctx, AV_LOG_DEBUG, "Compression level %d\n", avpkt->data[0] >> 
>> 4);
>> +    keyframe = (avpkt->data[0] & 0x03 == 3);
>
> '==' has higher operator precedence than '&'. You're probably not
> comparing what you intend to do

uuugh that stuff always catches me :(
I'll re-look at the whole set, thanks for the reviews
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to