History

avcodec/snowenc: sign extend a variable before shifting

Fixes "libavcodec/snowenc.c:718:27: runtime error: left shift of 8509032 by 8 places cannot be represented in type 'int'" as seen in fate-vsynth2-snow-hpel under ubsan.

James Almer committed 2 years ago

Commit 9880fea1 parent 7ad937f1 file · +1 −1Browse files

Unified · Split

libavcodec/snowenc.c+1−1
@@ -715,7 +715,7 @@ static int get_dc(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) · 714 unmodified lines
715 }715 }
716 *b= backup;716 *b= backup;
717 717
718 return av_clip_uint8( ROUNDED_DIV(ab<<LOG2_OBMC_MAX, aa) ); //FIXME we should not need clipping718 return av_clip_uint8( ROUNDED_DIV((int64_t)ab<<LOG2_OBMC_MAX, aa) ); //FIXME we should not need clipping
719}719}
720 720
721static inline int get_block_bits(SnowContext *s, int x, int y, int w){721static inline int get_block_bits(SnowContext *s, int x, int y, int w){

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t