It is unnecessary because an av_shrink_packet() a few lines below will set the size; furthermore, it is actually harmful, because av_shrink_packet() does nothing in case the size already matches, so that the packet's padding is not correctly zeroed.
Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -1132,7 +1132,6 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 1131 unmodified lines | |||
| 1132 | } | 1132 | } |
| 1133 | sm_size = avio_tell(bc) - pkt->pos; | 1133 | sm_size = avio_tell(bc) - pkt->pos; |
| 1134 | size -= sm_size; | 1134 | size -= sm_size; |
| 1135 | pkt->size -= sm_size; | ||
| 1136 | } | 1135 | } |
| 1137 | 1136 | ||
| 1138 | ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size); | 1137 | ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size); |